ReadyPlayer2 / nasa-playgrounds

React application to call the NASA APOD API and display returned images and videos
MIT License
2 stars 0 forks source link

Ability to use a random date in valid range for api calls #1

Closed ReadyPlayer2 closed 5 years ago

ReadyPlayer2 commented 5 years ago

Date is hardcoded so would be better to use any valid date from earliest valid date for APOD API.

ReadyPlayer2 commented 5 years ago

Earliest valid date appears to be June 16 1995 according to https://apod.nasa.gov/apod/archivepix.html.

Confirmed by trying outside this date:

{
    "code": 400,
    "msg": "Date must be between Jun 16, 1995 and Mar 27, 2019.",
    "service_version": "v1"
}
ReadyPlayer2 commented 5 years ago

Documentation suggests a count=n query parameter could be used in place of a date to return n random images in a JSON array. https://github.com/nasa/apod-api