Company Fundamentals Lab


Overview

Using the Intrinio Financial Data API (application programming interface) we can programmatically retrieve standardized fundamental company financials including Income Statements, Balance Sheet Statements and Cash Flow Statements.

We will use the Standardized Financials API end-point to retrieve standardized company financials throughout this lab.

In this lab we will cover:

  • Retrieving a Standardized Income Statement for Apple Inc. (AAPL) using Python or R
  • Retrieving 5 years of Standardized Income Statements for Apple Inc.
  • Charting 5 years of Total Revenue, Net Income, and R&D expenses from Apple's standardized Income Statements

Code Examples

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:

API Keys

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

Production
To view your API keys, click here to log in.

Section 1

Retrieving an Income Statement for Apple Inc.

In this section we use the Standardized Financials API end-point to retrieve the 2019 Fiscal Year Income Statement for Apple Inc.

Run the code below to see the result...

Section 2

Retrieving 5 years of Standardized Income Statements for Apple Inc.

Now that we've seen how to retrieve a Standardized Income Statement for a single fiscal year, let's create an array of multiple years and retrieve fiscal year Income Statements for all of them.

We'll iterate through an array of 5 years, executing an API call retrieve the Apple Inc. fiscal year Income Statement for each year.

Then, we'll process the API responses adding the income statements for each year to an 'income_statements' object.

Run the code below to see the result...

Section 3

Charting 5 years of Total Revenue, Net Income, and R&D expenses from Apple's standardized Income Statements

Building on our previous work, now let's create 3 graphs for 5 years of Total Revenue, Net Income, and R&D Expenses for Apple Inc.

To do so, we'll iterate through each of the income statements we added to our income_statements object, extracting the Total Revenue, Net Income, and R&D expenses.

We'll push the extracted values into new arrays representing each value type - Total Revenue, Net Income, and R&D expenses.

Once we have our Total Revenue, Net Income, and R&D expenses arrays populated we'll then create bar charts for each array.

Run the code below to see the result...

Going further...
  • Can you retrieve and chart 5 years of total assets and total liabilities from the balance sheets for Apple Inc.?
  • The charts in this lab are useful for understanding Apple's performance - how might we extend the charts to compare Apple's performance against Microsoft and Google?