Closed alxmjo closed 6 years ago
The API should be adding new photos within a day of when they are released by NASA. I think you may have raised to my attention that this isn't happening. That being said, you can also find the most recent sol
and earth_date
for each Rover by checking the Rover's endpoint. For example, /api/v1/rovers/curiosity
right now contains the data:
"max_sol": 1849,
"max_date": "2017-10-18",
Hope that helps, and I'll try to figure out why the latest images aren't appearing when I have a chance.
That's very helpful, thank you.
I suppose the best way to move forward then would be to query the API for a sol at which I know photos exist (since the object you mention above doesn't appear to be appended when the sol
parameter is not passed), get the max_sol
from that query, and then query again based on that value.
It still makes sense to me that querying without sol
would return the most recent photo(s), but I'm sure you've thought about this more than I have.
I wonder if I'm seeing some other unexpected behavior here. Based on the manifest (https://api.nasa.gov/mars-photos/api/v1/manifests/Curiosity?api_key=apikeygoeshere
) there should be photos from the NAVCAM
on Curiosity on sol 400. But querying https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?api_key=apikeygoeshere&camera=NAVCAM&sol=400&page=1
returns an empty array.
Am I doing something wrong here?
I'll take a look at the Manifest and see if either it or the photos endpoint is incorrect.
Ah, I've found the bug. It's an issue with the database confusing Curiosity's NAVCAM with the NAVCAM on Opportunity and Spirit. I should be able to fix it relatively quickly.
Ok, I think I've correct the issue. Let me know if you're still seeing any problems.
I'd like to query the API and pull the most recent 10 or so photos from each rover. I've noticed that there's no default for sol or earth_date, so requests without this parameter return empty. It seems that photos aren't added often enough to just query with today's date.
Obviously I can keep querying the API until I get back a non-empty
photos
object, but this seems overly hacky.Is there a better way? Or can I submit this as an idea?