-
Notifications
You must be signed in to change notification settings - Fork 0
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
Return empty response instead of 404 for no trades/market holidays - Historic Quotes ( NBBO ) #23
Comments
This is actually something that we are planning to make more clear in the responses we send out. |
@jbonzo thoughts? This DB code is thrown when we do not have any data for that date at all, for any ticker ( weekends / holidays ). If there is a DB table for that date, then we would return an empty array ( with 200 ) if there is no data. |
Yeah I think a good way to frame it is asking what it means if I think for this endpoints, and others like it, the For a given ticker Tl;DR
|
Empty results are the right response for valid tickers during time periods in which no quotes occurred. This would include weekends, holidays, overnight, maybe even trading halts. However, for genuinely missing data from Polygon's database, a non-200 response is more correct. It is the equivalent of throwing an exception, because the normal return value cannot hold the exceptional result. |
Data not available for 15th June for any of the tickers https://api.polygon.io/v2/ticks/stocks/nbbo/AAPL/2020-06-15?limit=10&apiKey=XXXXXXXXX {"error":"Unknown database error Please fix this issue, API keeps failing again & again for NBBO data. This is a well-known issue, historic quotes are important for any kind of analysis to estimate the cost of a trade. |
Is your feature request related to a problem? Please describe.
Sometimes request to
/v2/ticks/stocks/nbbo/{ticker}/{date}
returns 404 and the following response:After some testing, I have figured out that this response happens when the market was closed( holiday).
The current behavior says that something went wrong and some libraries throw exceptions because status is 404.
Describe the solution you'd like
If there is no data for the specific day, then the response should be 200 and contains an empty
results
field.The text was updated successfully, but these errors were encountered: