corincerami / mars-photo-api

A Rails API for photo data from NASA's Mars Rovers
https://api.nasa.gov/#MarsPhotos
GNU General Public License v3.0
352 stars 48 forks source link

Pagination not working as intended #35

Closed krtkush closed 7 years ago

krtkush commented 7 years ago

Hello!

The API's pagination functionality seems to have broken down.

Example -

  1. Page 1 for SOL 1475 https://api.nasa.gov/mars-photos/api/v1/rovers/Curiosity/photos?sol=1475&page=1&api_key=DEMO_KEY
  2. Page 2 for SOL 1475 https://api.nasa.gov/mars-photos/api/v1/rovers/Curiosity/photos?sol=1475&page=2&api_key=DEMO_KEY

API requests 1 and 2 are returning the exact same data. When, in fact, page 2 should not return any data at all. Replace page=1/page=2 with any other number and it'll still return the same data as that for page=1.

corincerami commented 7 years ago

The pagination was removed in an update released today. This is reflected in the documentation on GitHub but hasn't been updated on api.nasa.gov yet. There is currently a pull request open to update the documentation on api.nasa.gov.

krtkush commented 7 years ago

Thank you for the information.

Any particular reason why pagination was removed?

corincerami commented 7 years ago

It was removed from the photo endpoint because I had received feedback that it often required an excessive number of API calls in order to fetch all of the photos for a set of parameters, like in the case where there may be over 1,000 photos for a sol.