Skip to main content

Getting historical data

Learn how to use the start_date, end_date, and outputsize parameters effectively.

Written by Team
Updated over 5 months ago

To search for a specific period in an instrument's history, start_date and end_date parameters are your primary tools. However, mastering this technique requires understanding a few key nuances.


start_date

Using this parameter alone has no effect unless start_date exceeds the range specified by outputsize.

Example

This request will return the most recent 5 records, as the condition is met. However, if the start_date falls within the range between the current day and the outputsize limit, truncation will occur.


end_date: This parameter defines the maximum possible datetime value for the time series.

In this case, the output will include the last five records: [2020-05-05, 2020-05-04, 2020-05-01, 2020-04-30, 2020-04-29]. The number of rows is entirely determined by the outputsize parameter.


start_date and end_date: When used together, these parameters set the lower and upper boundaries for the response.

This request returns all values between the specified dates. Note that the outputsize parameter is omitted in this case; including it would restrict the output.


General Recommendations:

  • A maximum of 5,000 data points can be retrieved in a single request. This limitation exists to ensure optimal server processing and maintain performance standards.

  • Before deploying to production, ensure a thorough understanding of how these parameters behave, particularly in edge cases.

  • To access specific sets of data efficiently, always include appropriate start_date and end_date parameters in your API calls.

Did this answer your question?