最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Failing to initialise a new USGS API instance - Stack Overflow

programmeradmin2浏览0评论

I have an account on the USGS and when I try to create an API instance using this code

from landsatxplore.api import API
import os

# Your USGS  credentials
username = '<username>'
password = '<password>'

# Initialize a new API instance
api = API(username, password)

# Perform a request
response = api.request(endpoint="dataset-catalogs")
print(response)

I get this error message:

landsatxplore.errors.USGSError: NOT_FOUND: Invalid Endpoint.

Python version: 3.10

landsatxplore version: 0.15.0

I have an account on the USGS and when I try to create an API instance using this code

from landsatxplore.api import API
import os

# Your USGS  credentials
username = '<username>'
password = '<password>'

# Initialize a new API instance
api = API(username, password)

# Perform a request
response = api.request(endpoint="dataset-catalogs")
print(response)

I get this error message:

landsatxplore.errors.USGSError: NOT_FOUND: Invalid Endpoint.

Python version: 3.10

landsatxplore version: 0.15.0

Share Improve this question asked Mar 15 at 10:23 FedericoFederico 4431 gold badge5 silver badges22 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

If you're talking about this landsatxplore package, it is no longer maintained and notably the new way to login to the API via token is not supported, so the package broke in February 2025:

https://github/yannfet/landsatxplore/issues/126

发布评论

评论列表(0)

  1. 暂无评论