Say you want a small table: revenue, gross profit, operating income and net income for NVIDIA, AMD and Intel over the last five years. Or a list of every 8-K a company filed this year, with what each one was about. All of this is public. US companies file it with the SEC, and EDGAR publishes it for free.
The SEC also offers free JSON APIs on data.sec.gov, and if you need one company once, they work. The friction shows up when you go beyond that. You have to map tickers to 10-digit CIK numbers yourself (the ticker list is a separate file), send a User-Agent that identifies you, and stay under the SEC's limit of 10 requests per second. The financial data comes as one large JSON document per company, organized by XBRL tag, and companies switch tags over the years: revenue can be under Revenues, SalesRevenueNet or RevenueFromContractWithCustomerExcludingAssessedTax depending on the year. Turning that into one row per year takes real code.
This tutorial uses an Apify Actor that does that work and gives you flat rows: one per filing, or one per company and period with the main numbers as columns.
Disclosure: I built and maintain this Actor. It is a paid tool ($1.00 per 1,000 results). Everything it returns comes from the SEC's public APIs; the value is in the cleanup, not in secret data.
What you can do with the data
- Compare companies. Revenue growth, gross margin and operating margin for a peer group, per year or per quarter.
- Monitor filings. Every new 8-K of your portfolio companies, with the item descriptions ("Results of Operations and Financial Condition", "Departure or Appointment of Directors...") already filled in.
- Search all filings. Full-text search across every company since 2001, for example 10-Ks that mention "going concern", or every new S-1 filed in the last 7 days.
Step 1: Set up a run in Apify Console
Open SEC EDGAR Scraper and click Try for free. The input fields:
| Field | What it does |
|---|---|
What to scrape (mode) |
filings (company filings, default), search (full-text search or latest filings) or financials (income statement, balance sheet, cash flow numbers). |
Companies (companies) |
Tickers (AAPL), CIK numbers (320193) or names (Microsoft). Needed for filings and financials. |
Form types (formTypes) |
Optional, e.g. 10-K, 10-Q, 8-K, 4, S-1, DEF 14A. |
Search words (searchQuery) |
For full-text search. Use double quotes for an exact phrase. Leave empty to get the latest filings. |
From date / To date (dateFrom, dateTo) |
YYYY-MM-DD. Filing date for filings and search, period end date for financials. |
Include amendments (includeAmendments) |
Also keep 10-K/A and similar. Default on. |
Financial periods (financialPeriod) |
annual (default), quarterly or both. |
Max results (maxItems) |
Default 100. |
Max results per company (maxItemsPerQuery) |
Newest first, so one company doesn't use up the run. |
No API key, login or proxy is needed.
Step 2: Run it and export
For this article I ran financials mode for three chip makers:
{
"mode": "financials",
"companies": ["NVDA", "AMD", "INTC"],
"financialPeriod": "annual",
"maxItemsPerQuery": 5,
"maxItems": 15
}
It finished in about 4 seconds and saved 15 rows, five years per company. Here is NVIDIA's latest year, unchanged except for a few removed fields:
{
"type": "financials",
"companyName": "NVIDIA CORP",
"cik": "0001045810",
"tickers": ["NVDA"],
"period": "CY2025",
"periodType": "annual",
"periodStart": "2025-01-27",
"periodEnd": "2026-01-25",
"fiscalPeriod": "FY",
"form": "10-K",
"filedAt": "2026-02-25",
"accessionNumber": "0001045810-26-000021",
"currency": "USD",
"revenue": 215938000000,
"costOfRevenue": 62475000000,
"grossProfit": 153463000000,
"researchAndDevelopment": 18497000000,
"operatingIncome": 130387000000,
"netIncome": 120067000000,
"epsDiluted": 4.9,
"operatingCashFlow": 102718000000,
"capitalExpenditure": null,
"totalAssets": 206803000000,
"stockholdersEquity": 157293000000,
"cashAndEquivalents": 10605000000,
"longTermDebt": 7469000000
}
Two things to notice. First, period is a calendar label: NVIDIA's fiscal year ends in late January, so the year ending 2026-01-25 shows up as CY2025. That's how the SEC aligns numbers, and it's what lets you put companies with different fiscal years side by side. Second, capitalExpenditure is null here. The Actor reads standard tag names, and when a company reports a number under a different tag, the field stays empty.
One more thing showed up in the raw rows: NVIDIA's diluted EPS is 3.85 for CY2021 and 0.17 for CY2022. The CY2021 number comes from a 10-K filed in 2022, before NVIDIA's 10-for-1 stock split in 2024; the CY2022 number comes from a filing made after it. Check filedAt before you compare per-share values across years, or compare netIncome instead.
Step 3: Do it from Python
pip install apify-client pandas
from apify_client import ApifyClient
import pandas as pd
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("pipiagent/sec-edgar-scraper").call(run_input={
"mode": "financials",
"companies": ["NVDA", "AMD", "INTC"],
"financialPeriod": "annual",
"maxItemsPerQuery": 5,
})
df = pd.DataFrame(client.dataset(run.default_dataset_id).iterate_items())
df["ticker"] = df["tickers"].str[0]
df = df.sort_values(["ticker", "periodEnd"])
df["grossMargin"] = df["grossProfit"] / df["revenue"]
df["operatingMargin"] = df["operatingIncome"] / df["revenue"]
df["revenueGrowth"] = df.groupby("ticker")["revenue"].pct_change()
# Revenue in billions, one column per company
revenue = df.pivot(index="period", columns="ticker", values="revenue") / 1e9
print(revenue.round(1))
latest = df[df["period"] == "CY2025"]
print(latest[["ticker", "periodEnd", "grossMargin", "operatingMargin", "revenueGrowth"]].round(3))
On my test data, the revenue table looks like this:
ticker AMD INTC NVDA
period
CY2021 16.4 79.0 26.9
CY2022 23.6 63.1 27.0
CY2023 22.7 54.2 60.9
CY2024 25.8 53.1 130.5
CY2025 34.6 52.9 215.9
And for the latest year, gross margin was 0.711 for NVIDIA, 0.495 for AMD and 0.348 for Intel; revenue growth was 0.655, 0.343 and -0.005.
The same client works for filings. This gets the latest 8-Ks of a few companies and keeps the earnings releases (item 2.02):
run = client.actor("pipiagent/sec-edgar-scraper").call(run_input={
"mode": "filings",
"companies": ["NVDA", "AMD", "INTC"],
"formTypes": ["8-K"],
"maxItemsPerQuery": 20,
})
filings = pd.DataFrame(client.dataset(run.default_dataset_id).iterate_items())
earnings = filings[filings["items"].apply(lambda items: "2.02" in items)]
print(earnings[["companyName", "filingDate", "documentUrl"]])
What it costs
You pay per saved result: $1.00 per 1,000 results. A filing, a search result and a financial period each count as one. There is no start fee and no monthly rental.
- My 15-row test: $0.015.
- The last 100 filings of a company: $0.10.
- 10 years of annual numbers for 100 companies (about 1,000 rows): about $1.00.
You can set a maximum charge per run in the run options, and the Actor stops when it reaches it.
Limitations
These come from the README and from how EDGAR data works:
- Financials come from XBRL, which US companies have filed since about 2009 to 2011. Funds, foreign companies filing 20-F and many very small companies have little or no XBRL data.
- Fourth quarters are often missing in quarterly mode, because most companies report Q4 only inside the annual report. Compute it as the annual number minus the first three quarters.
-
A number is empty when the company doesn't use the standard tag, like
capitalExpenditurefor NVIDIA above, or gross profit for banks. -
Each number comes from the filing the SEC matched to that period, which isn't always the latest one. That's why EPS can jump across a stock split, and why
fiscalYearcan show the year of that filing rather than of the period itself (NVIDIA'sCY2024row showsfiscalYear: 2026). Useperiod,periodStartandperiodEndfor dates. - Full-text search covers 2001 onward and returns at most 10,000 documents per search. Narrow by dates or form types to get everything.
- Companies without a ticker need their CIK number.
- Links point to sec.gov. The Actor doesn't download the documents themselves.
Related tools
If you want the news around a filing, Google News Scraper exports articles by keyword and date range. For macro context, Kalshi Markets Scraper exports prediction market odds, such as the market's probability of a Fed rate change.
The input form and more examples are on the SEC EDGAR Scraper store page. If a number looks wrong or a field is missing, open an issue there and I'll look into it.
Top comments (0)