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
346 stars 46 forks source link

Pagination support in Mission Manifest of rovers #114

Closed Shwetank-Bhardwaj closed 3 years ago

Shwetank-Bhardwaj commented 3 years ago

I am making an android application which displays a list of "objects under the "photos" key which are grouped by sol" Currently, there are close to 2800 objects in that section. This much data is causing UI to render slowly. It would be great to have pagination support so that I can request according to my need

paorpires commented 3 years ago

Try not to fetch the photos directly, but going to rover -> camera -> sol date -> photos

Shwetank-Bhardwaj commented 3 years ago

I am not fetching photos. I am fetching Mission Manifest and displaying like in the screenshot In this list, there are 2800 objects which are causing render problems. This is the endpoint I am hitting: https://api.nasa.gov/mars-photos/api/v1/manifests/curiosity?api_key=DEMO_KEY

WhatsApp Image 2020-07-16 at 11 44 49 PM

corincerami commented 3 years ago

Would it be possible for you to fetch the full manifest and then paginate the data in your application, and only render a certain number of elements at a time?

Shwetank-Bhardwaj commented 3 years ago

It is possible and I was also thinking about that. You can add this issue as a suggestion for Mission Manifest API. It would be efficient for an API to handle pagination.