1. Products

How To Use The Historical Data Endpoint

A primer on when to use the frequency and type parameters when pulling data for the historical data endpoint, with API examples.

WHAT IS THE HISTORICAL DATA ENDPOINT?

The historical data endpoint is incredibly flexible, as you're able to utilize that endpoint to bring in data across almost of our products. As such, it's important to know when to use the Frequency parameter, vs. when to use the Type parameter.

WHEN DO I USE THE FREQUENCY PARAMETER?

The Frequency parameter should be used only for non-fundamental items that are updated at a frequency higher than quarterly. Examples include pricing data and marketcap.

For example, to return the historical weekly marketcap for a security, run this in the API:

https://api-v2.intrinio.com/historical_data/AAPL/marketcap?frequency=weekly

Along with weekly, you also have the options for daily, monthly, quarterly, and yearly frequencies.

If no frequency is specified, the endpoint will by default return the highest frequency available for that item. So for marketcap, the below would return the historical daily values:

https://api-v2.intrinio.com/historical_data/AAPL/marketcap

WHEN DO I USE THE TYPE PARAMETER?

The Type parameter should be used strictly for fundamental items directly from the 10-K and 10-Qs. Examples include total revenue, debt, and cash from operating activities.

For example, to return the historical QTR total revenue from the 10-Qs, run this in the API:
https://api-v2.intrinio.com/historical_data/AAPL/totalrevenue?type=QTR

Along with QTR, you also have the options for FY, TTM, and YTD types.

If no type is specified, the endpoint will by default return the quarterly TTM values for income statement and cash flow statement items, and QTR values from the balance sheet. So, for total revenue, the below would return the quarterly TTM values: 

https://api-v2.intrinio.com/historical_data/AAPL/totalrevenue

There is an exception to the type parameter: if you specify a frequency with a fundamental item, such as total revenue, it will default to return the TTM values at the specified frequency. So the below would return the quarterly TTM values, same as if you did not specify a Type or Frequency: 

https://api-v2.intrinio.com/historical_data/AAPL/totalrevenue?frequency=quarterly