Analysing Company Earning Calls with Python

Building a Python script to analyse company earning calls.

Jose Manu (CodingFun)
Towards Data Science

--

During this post, we will extract the main key points on the company recent and future performance as stated by management in the latest earning calls.

The code will be very simple. We will pass the ticker of any company of our interest and the outcome will be an amazing short summary of the earnings call.

Photo by Karolina Grabowska on Pexels.com

Why to Analyse Company Earning Calls

Company earning calls is one of the main sources of information to understand how businesses are doing and what are expectations for next quarters.

Company earning calls are publicly available. Normally, we can visit the website of the company and dial in to the call to hear what management has to say. Earnings call are normally scheduled the same day that company earnings are publicly released. The structure of the call is simple, management gives an overview of the last quarter operations and future guidance. In addition, journalists are able to ask questions about the business to the top management.

They are quite insightful to listen to. However, it may be time consuming to go through the whole call, especially, if we are interested in multiple companies.

Therefore, what we will do in this post is to automate the analysis of company earning calls using Python.

How can Python help to Analyse Company Earning Calls?

With Python, we are not only able to perform quantitative analysis as we learnt in my previous posts. Among other things, we can, for example, use natural language processing in order to analyse linguistic structure or perform sentiment analysis.

In this post, we are going to focus on passing a full transcript from company earning calls as an input. Then, we will extract key points that will help us to understand where a company is heading to and how was the recent performance. Below are some of the questions that we will answer:

  • How did the company do in the last quarter?
  • What is the expected growth in sales?
  • Which line of products is performing better?
  • Is the company expected to increase net profit?
  • And many more

Python Script to Analyse Company Earnings Calls

We start our code by making a get request to financialmodelingprep in order to retrieve the transcript of the latest earnings.

In this post, we will analyse Apple, but feel free to change the name of the company to analyse any other company. Also, uncomment the variable demo and pass your API key (you can get one for free in financialmodelingprep upon registration) in order for the request to the API to work.

Then, we store the full string that we get back from the API in the variable transcript. Next, we can use the Python split method. That method will create a Python list containing the script split by each of the new lines (i.e. /n character) as shown in below outcome.

import requests
import pandas as pd

#demo= 'your api key'

company = 'AAPL'

transcript = requests.get(f'https://financialmodelingprep.com/api/v3/earning_call_transcript/{company}?quarter=3&year=2020&apikey={demo}').json()

transcript = transcript[0]['content'].split('\n')
print(transcript)

#outcome
["Operator: Good day, everyone. Welcome to the Apple Incorporated Third Quarter Fiscal Yea

Now that we have a Python list with each of the sentences of the latest Apple earning calls, we will pass it to a Pandas DataFrame. We will use Pandas to analyse the earnings transcript. We will search for the word “expect” to keep all sentences where the word expect is included.

earnings_call = pd.DataFrame(transcript,columns=['content'])
word_to_analyze = 'expect'

analysis = earnings_call[earnings_call['content'].str.contains(word_to_analyze)]
text_earnings = analysis['content'].values

Then, within the analysis variable, we filter out all sentences where we have the expect word using the str.contains method. Feel free to change the word to analyse any other aspect of the company such as revenue or profits.

Then, we extract the values from the pandas series in order to get our sentences as shown below. Only sentences with the word expect are kept.

print(text_earnings)
#outcome
array(["Tim Cook: Thanks, Tejas. Good afternoon, everyone. Thanks for joining the call today. Be...

If you have a further look into the text_earnings variable, you will see that some of the sentences are still too long. We will loop through them in order to split them every time that we have a “.”. And then, we will print only the sentences where the word expect is found:

for text in text_earnings:
for phrase in text.split('. '):
if word_to_analyze in phrase:
print(phrase)
print()

#outcome
Due to the uncertain and ongoing impacts of COVID-19, we did not provide our typical guidance when we reported our results last quarter, but we did provide some color on how we expected the June quarter to play out

In April, we expected year-over-year performance to worsen, but we saw better-than-expected demand in May and June

We expected iPad and Mac growth to accelerate and we saw very strong double-digit growth for these devices this quarter

Wearables growth decelerated as we expected, but still grew by strong double-digits and set a revenue record for a non-holiday quarter

First, results for advertising and AppleCare were impacted by the reduced level of economic activity and store closures to a degree that was in line with our expectations

However, we will provide some additional insight on our expectations for the September quarter for our product categories

On iPhone, we expect to see recent performance continue for our current product lineup, including the strong customer response for iPhone SE

We expect the rest of our product categories to have strong year-over-year performance

For services, we expect the September quarter to have the same trends that we have observed during the June quarter except for AppleCare where during the September quarter a year ago we expanded our distribution significantly

As a consequence, we expect a difficult comp for AppleCare also considering the COVID related point of sale closures this year

For OpEx, we expect to be between $9.8 billion and $9.9 billion

We expect the tax rate to be about 16.5% and OI&E to be $50 million

First one, Tim, when you look at the services business and in terms of your TV+ content production have the movement restrictions impacted the content production efforts? And along the same path four years ago your premonition on services being a $50 billion business in 2020 came sooner than expected, I don't know if you want to make any such forecast four years out and how you think services revenue is going to be

With the strong sales in Mac given the shelter-in-place, do you think the back-to-school season got pulled in by a quarter or do you expect the momentum to still continue? Thank you very much.

Luca Maestri: As I said, when I was talking about providing some commentary for the September quarter, we expect all the non-iPhone product categories to have a very strong year-over-year performance

So we expect the performance that we've seen for Mac in the June quarter to continue.

And then, can you talk a little bit more about the decision to bring Mac Silicon in-house, then the benefits that you

Wrapping Up

Finally, we have summarised the earnings call to extract key information for our analysis. From the example above, we can quickly and easily see that:

  • Apple had better than expected demand in May and June
  • Apple achieved very strong revenue growth and marked a new non-holiday quarter record
  • For the rest of the year, strong performance year to year expected
  • OpEX to be around $9.9 billion
  • Product category performance

The cool thing about this script is that you can replace expect by the word to analyse (e.g. profits) and you will get a short summary for any company of your interest.

In future posts, we will continue analysing earning calls transcript performing a Python NLTK sentiment analysis.

In the meantime, you can keep reading any of my other posts on Python for Finance.

Originally published at https://codingandfun.com on October 18, 2020.

--

--

Python for Finance. Learn step by step how to automate cool financial analysis tools.