Page 1 of 1

AppEEARS API

Posted: Wed Apr 06, 2022 9:12 am America/New_York
by bholmes
Hi all,

I have been following the AppEEARS API Python tutorial [1] and have a quick question with regards to the API URL. The article indicates that the API URL should be "https://lpdaacsvc.cr.usgs.gov/appeears/api/". However, when I attempt to generate a token with the following code:

api = 'https://lpdaacsvc.cr.usgs.gov/appeears/api/'

token_response = requests.post('{}login'.format(api), auth=(username, password)).json()

I receive the following error:
"JSONDecodeError: [Errno Expecting value] <html> <head><title>405 Not Allowed</title></head> <body> <center><h1>405 Not Allowed</h1></center> <hr><center>nginx</center> </body> </html> : 0"

In the AppEEARS API documentation [2], a different API URL is given "https://appeears.earthdatacloud.nasa.gov/api/". When I use this API URL no errors are returned and I receive a user token as expected.

My question is, why does the first URL fail and is there any drawback to using the second URL?

[1] https://lpdaac.usgs.gov/resources/e-learning/getting-started-with-the-a%CF%81%CF%81eears-api-submitting-and-downloading-an-area-request/
[2] https://appeears.earthdatacloud.nasa.gov/api/

Re: AppEEARS API

Posted: Mon Apr 11, 2022 3:10 pm America/New_York
by LP DAAC - lien
Hi,
Sorry for the hassles with this, the tutorial has not been updated yet. Two weeks ago today AppEEARS was moved into the cloud. So that second URL (https://appeears.earthdatacloud.nasa.gov/api/) is correct.
Thanks,

Brett