Historical Data API

I understand that free subscriptions have a 15-minute delay for historical data, but getting the most recent available data gets tricky. Since time is not synced between the server and clients, sometimes, when I ask for a quote from 15 minutes ago, I get the error:

{"message":"subscription does not permit querying recent SIP data"}

That brings me to the following suggestion:

Why can’t the response simply cut what is not available or permitted and return useful data anyway?

For example, suppose I ask for the TSLA ticker from yesterday’s midnight to tomorrow’s afternoon (yeah, the future time) and sort it desc, with limit 1. In that case, the API should return the latest available data, i.e., 15 minutes ago for a free subscription, and the most recent data for a paid subscription.

Wouldn’t that be great? This behavior would surely also lead to fewer server requests, making it a win-win scenario.

What are your thoughts?

Hey :wave: There’s an even easier solution to your issue: if you don’t have a subscription and you query the historical endpoints without providing the end parameter, it will automatically be set to now - 15 minutes on the server side, as documented for example under the bars endpoint:

end
The inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD.
Default: current time if feed is not sip or if the user has a subscription, 15 minutes before the current time otherwise.