Using the Intrinio Financial Data API (application programming interface) we can programmatically retrieve historical company data points such as Total Revenue, Net Income, Debt, Gross Margin, Market Cap, Beta and numerous others.
We will use the Historical Data for Company API end-point to retrieve historical company data points throughout this lab.
In this lab we will cover:
Code examples in Python and R are provided throughout this lab.
All code examples can be run in your browser using a Jupter Notebook. To launch the Jupyter Notebook for any code example simply click the Run Jupyter Notebook button at the top of the code example.
If you wish to run the code examples in your own development environment, be sure to first install the Intrino SDK for the language of your choice:
In code examples throughout this lab you will be asked to provide your API Key.
The API keys assigned to you are available below.
For the purposes of this lab, be sure to use your Production API key
In this section we use the Historical Data for Company API end-point to retrieve Total Revenue, Market Cap, and Beta for Apple Inc. since 2010.
Total Revenue, Market Cap, and Beta values can be retrieved from the Historical Data for Company end-point using the concept of 'Data Tags'. Each 'Data Tag' represents a type of data point - such as Total Revenue, Net Income, or Debt.
In the Data Tag Reference Library you'll find a listing of all Data Tags supported by the Intrinio Financial Data Platform.
In this lab we'll be using the following Data Tags:
Item | Data Tag |
---|---|
Total Revenue | totalrevenue |
Market Cap | marketcap |
Beta | beta |
While retrieving all historical data values for each Data Tag, we'll extract the historical data values from the API response as an array. We'll then store this array of data tag values in a new object called 'historical_data'.
Run the code below to see the result...
Building on our previous work, now let's iterate through our 'data_points' array to graph the Total Revenue, Market Cap, and Beta for Apple Inc.
Run the code below to see the result...