Access Executive Compensation Data With Python

In this guide, we'll explore how to find compensation data of executives working at publicly listed companies using Python and the Compensation API.

Quick Start

How to get executive compensation data by ticker?

The Python code below returns all compensation data of Microsoft, starting from the most recently reported year 2021 and going back to 2006. The response is stored in result_ticker as a list of dictionaries. The resulting list of executice compensation data can be converted into a Pandas dataframe with a single line of code. Each dict entry in the list represents an executive's compensation data for a specific year.

For example, the first element in the list result_ticker[0] represents Jean Philippe Courtois' compensation in 2021. He earned a salary of $932,167 and received stock awards of $12,141,344. His total compensation was $16,809,865.

How to look up executive compensation data by CIK?

In the first example we list all compensation data of Facebook by its CIK 1326801. The first item result_cik[0] shows Mark Zuckerberg with a total annual compensation of $26,823,061 in 2021.

The second example uses the query functionality of the compensation API. Here we list all compensation items of executives working at Tesla, Amazon, Microsoft and Google in 2021 and 2020. The result is sorted by total annual compensation, starting with the highest value. The top four places go to Google with a total compensation between $66 million and $50 million in 2020. In comparison, Elon Musk didn't draw a salary in 2020 at all.

How to export executive compensation data into Excel?

The example code downloads all compensation data of Microsoft's executives and saves the data in the Excel file exec-compensation-MSFT.xlsx. Each row represents an executive's compensation in a single year. Salary, bonus, stock awards, option awards and more are included. The data includes over 15 years of compensation history.

We can also export compensation data from multiple companies into a single Excel sheet. Instead of quering the API by ticker, we can send a more complex search query and export the result.