EDGAR Tools: An Awesome Python Package to Get SEC Filings (It’s Free)
Working with SEC Filings of Public Companies

Today, we’re talking about the best EDGAR library we have ever seen! We’ve tested many EDGAR libraries in the last year, and none of them have met our requirements. The libraries often have low functionality or have not worked properly. In addition, the libraries often had poor documentation. This article shows you a library that has convinced us!
Maybe you’re wondering what EDGAR even is. EDGAR stands for Electronic Data Gathering, Analysis, and Retrieval, and it is a database for legally required reports of all reportable companies. The United States Securities and Exchange Commission (SEC) manages this database. The filed reports are called SEC filings.
In this article, we look at the Python package edgartools, a very well-structured EDGAR library. We have tested the library, and it is very comprehensive. In addition, it is very powerful and easy to use. And the best, you don’t need an API key from the SEC. With this package, you can filter, query and select every filing since 1994. Furthermore, you can view the filing’s html, xml and text.
For instance, you can get Tesla’s current balance sheet with two lines of code:

In today’s competitive job market, mastering a range of technical skills is more important than ever. The 100-hour course “The Complete Excel, AI and Data Science Mega Bundle“* is designed to equip you with in-demand capabilities in Excel, Python, and Machine Learning for stock prediction.
✅ Initial Setup
In this section, we discuss all that you need to use the Python package.
You will need the following prerequisites:
- Installed Python, conda and pip
- Access to a bash (macOS, Linux or Windows)
- Code editor of your choice (We use VSCode.)
Enter the following in your terminal:
- Create a conda environment (env):
conda create -n edgar python=3.9.12-> Answer the question Proceed ([y]/n)? with y. - Activate the conda env:
conda activate edgar - Install the Python package edgartools:
pip install edgartools
Great, we have installed the Python package. Next, we have to set the edgar user identity. You can do this in several ways.
For instance, in your terminal:
# Linux/ Mac
export EDGAR_IDENTITY="FirstName LastName [email protected]"
# Windows
set EDGAR_IDENTITY="FirstName LastName [email protected]"Or you do it with Python:
from edgar import set_identity
set_identity("FirstName LastName [email protected]")Replace the placeholders with your information. Great, we have set up everything. Let’s dive in!
💻 Working with the Company API
First, we need a company that we want to analyse. For example, we choose the Tesla stock with the ticker “TSLA”. The package supports the ticker and the Central Index Key (CIK) to get a company object.
company = Company("TSLA")
# or
company = Company("0001318605")If you don’t know the CIK for a specific company, you can look up it on the CIK lookup webpage of the SEC.
Company’s Balance sheet
You can request Tesla’s current balance sheet with the following Python code:
company.financials.balance_sheet
Here you can see the output of the code:

The balance sheet is an important instrument to analyse a specific company. It contains several financial facts about a company. The balance sheet lists the assets, liabilities and equity of a company at a specific time.
A balance sheet usually consists of two columns. The first column lists the assets of the company. The second column contains the liabilities and equity of the owner or owners.
Company’s Cash Flow Statement
Next, we look at the cash flow statement of Tesla:
company.financials.cash_flow_statement
In the following you can see the output of the code:

The cash flow statement provides information about the cash inflows and outflows of a company. We can see the net income, the tax expense, and some other points.
The net cash from operating activities (operational business) represents the cash flows from Tesla’s core business and is the core of the cash flow statement. It represents the inflows and outflows of current business activities. A company can use positive net cash from operating activities for the repayment of loans or new investments. A negative cash flow must be covered by loans. (cf. [1])
The net cash used in investing activities indicates investments such as cash outflows for buildings, machinery or land. (cf. [1])
The net cash used in financing activities considers the financing activities of a company. It is negative when liabilities are repaid, dividends are paid or shares are repurchased. (cf. [1])
SEC Filings
In this section, we look at how you can access the most popular SEC filings from companies.
10-Q Form
Listed companies in the USA must publish the SEC’s 10-Q form every quarter. It is an interim report intended to serve as information for investors and stakeholders. In the first three quarters, a company publishes the 10-Q form, and in the fourth quarter it is replaced by the 10-K form (annual report). The quarterly report and the 10-Q form are not necessarily the same document. The 10-Q form is formal and more suitable for professionals. The quarterly report, on the other hand, is intended for the public. (cf. [2])
You can request Tesla’s latest 10-Q form with the following line of code:
company.get_filings(form="10-Q")[0].html()The function returns the html content of the 10-Q form.
10-K Form
Listed US companies must submit the 10-K Form with the SEC as the financial statement for a fiscal year. The 10-K Form is an important document for investors as it provides comprehensive information on the current state of the company.
The document contains a detailed description of the company and its business activities, the associated risks and legal issues, as well as a detailed list of the operational and financial results. Furthermore, the management comments on the results and the development of the business areas in a letter to the investors. (cf. [3])
You can request Tesla’s latest 10-K form with the following code:
company.get_filings(form="10-K")[0].html()The function returns the html content of the 10-K form. You can see that we have only changed the form type in the function get_filings(). Very easy, right?
8-K Form
The 8-K form is a report that companies must publish when unplanned events occur. Furthermore, the information must be of interest to investors, as it could influence the stock price. Common reasons for an 8-K form are the acquisition of other companies, changes in management or a possible insolvency application. (cf. [4])
You get the latest 8-K form of Tesla with the following code:
company.get_filings(form="8-K")[0].html()The function returns the html content of the 8-K form.
13F-HR Form
Institutional investors with more than $100 million in assets must submit the 13F-HR form to the SEC every quarter. In the filing, they report about investments and holdings they currently own. The goal of the 13F-HR form is to increase transparency for other market participants (cf. [5]). In this way, it informs the public about the investments of the largest investors in the USA.
The form contains the investor’s current positions. The time of purchase and sale of a stock does not have to be published in the form. It is not visible at which time the investor buys or sells.
Another disadvantage is that the form does not have to be submitted until 45 days after the end of the quarter. Large managers/investors usually submit the form very late. So the public is informed with a long delay. The money of the large managers/investors is then already invested or withdrawn for several months.
You get the latest 13F-HR form (Berkshire Hathaway Inc.) with the following code:
company = Company("BRK-A")
company.get_filings(form="13F-HR")[0].html()The function returns the html content of the latest 13F-HR form (Berkshire Hathaway Inc.).
🎬 Conclusion
In this article, we introduced you to the Python package edgartools. It is comprehensive and gives you access to the most important SEC filings. You can request any filing since 1994 easily. And the best, you don’t need an SEC API Key. You only have to set your edgar user identity. This Python package is powerful, easy to use and well-structured. Try it out! It’s worth it!
👉🏽 Join our free weekly Magic AI newsletter for the latest AI updates!
👉🏽 You can find all our Freebies on our digital products page!
Subscribe for free to get notified when we publish a new story:
Learn more about us on our About page. Don’t forget to follow us on X. Thanks so much for reading. If you liked this article, feel free to share it. Have a great day!
Sign up for a Medium membership using our link to read unlimited Medium stories.
🔍 References
[1] Cash Flow Statement — Definition & Berechnung (Accessed on 03.08.2023)
[2] Form 10-Q SEC Report — Erklärung & Beispiel (Accessed on 03.08.2023)
[3] Form 10-K SEC Filing — Definition & Erklärung (Accessed on 03.08.2023)
[4] Form 8-K SEC Filing — Definition & Erklärung (Accessed on 03.08.2023)
[5] Form 13F SEC Report — Erklärung & Beispiel (Accessed on 03.08.2023)
* Disclosure: The links are affiliate links, which means we will receive a commission if you purchase through these links. There are no additional costs for you.
Towards Finance
Thank you for being part of the TF community.
- 📚 View more content in the Towards Finance publication.
- 🚀 Subscribe to our monthly Towards Finance Newsletter.
- 🪄 Join our weekly Magic AI Newsletter for the latest AI updates.
- 🤝🏽 Follow us on X and LinkedIn for more finance and data science content.






