-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API returns 404 "No data available" when asking for latest date #48
Comments
I'm having this issue right now |
Yeah, it happens every evening when the date changes. (Edit: at least I've noticed it for a couple days in the past week.) |
I’ve never had it happen like this. |
Client-side solution: https://github.com/gumbarros/kepler/blob/master/lib/src/services/api/api.dart#L38 |
…om encoding logic
My workaround (above) is to request a date range starting from yesterday and using the last item in the returned list. I don't include the end_date because an end_date of tomorrow returns a 400 error 😕 |
I had been wondering about this myself. Found it when my code started crashing at exactly 8pm EDT. I assumed it was intentional but couldn't imagine why the date parameter, when left out, defaulted to "today UTC" and not "most recent valid date". Would certainly make things easier for users. |
I'm using the APOD API in Cypht (https://github.com/jasonmunro/cypht) and found it morning, that there was no new picture at 04:30am CET but at 06:30am - after a quick glance at nasa.gov it seems that they format all their times in EST/EDT. |
@kmpoppe I'm doing the same in a wrapper I'm preparing . Seems to be the only plausible solution :/ |
@elementh I've linked my PR for the Cypht project. Maybe you can find some inspiration there. |
@kmpoppe I will, thank you very much! |
#51 should have fixed this issue, no? |
but that means having specific code to handle a whatever means "today" for the user and erase that from the request. #51 It's helpful but can still can't handle every case. |
When I make an API call to
https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY
right now (Thu, 01 Oct 2020 01:30:49 GMT) I get a 404:It’s currently Sep 30 in my time zone, not Oct 1. I understand if the server wants to give me Oct 1’s image after midnight UTC, but if so it shouldn’t give me a 404.
I suspect that's because the "current date" default sometimes changes before the image is actually made available (due to time zone differences, maybe?):
apod-api/application.py
Lines 127 to 129 in a434768
However it looks like there is already some code to handle this. So I guess that's not working properly:
apod-api/apod/utility.py
Lines 263 to 271 in a434768
The text was updated successfully, but these errors were encountered: