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

Remove photos entry from rovers manifests result support when query #176

Open softwarega opened 1 year ago

softwarega commented 1 year ago

Imagine that we need to show info about rovers in a home page, and we need to do it via their manifest, but, in this query we are getting the necessary info and the photos too, so it is more expensive than if we will have a way to say to the api, hey remove the entry photos, i don't need that at this time, it will take so long time as i need for just show the rover info.

I think we could have this approach adding a URL param maybe no_photos as a bolean, by default, the query return all, but if we pass the param, then the entry photo not come into response.

Something like this: https://api.nasa.gov/mars-photos/api/v1/manifests/opportunity?api_key=DEMO_KEY&no_photos=true