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/
AppEEARS API
-
- Posts: 249
- Joined: Thu Jun 25, 2020 9:51 am America/New_York
- Been thanked: 9 times
Re: AppEEARS API
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
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