The SEC EDGAR API is one of the most valuable free data sources available to developers, analysts, and researchers. It provides programmatic access to every filing submitted by every public company in the United States — over 10 million documents going back decades. No API key, no payment, no subscription required.
This guide covers the full EDGAR API as of 2026: all major endpoints, the authentication requirement, rate limits, and practical code examples for the most common use cases. For a quick lookup of company financials from any filing, you can also use TL;DR Filing's company search to get summarized data without writing any code.
https://data.sec.gov/ as the base. The older efts.sec.gov full-text search system is separate and operates differently.Authentication: User-Agent Header Required
The EDGAR API requires no API key, but it does require a User-Agent header in every request identifying who you are. The SEC's acceptable use policy asks that you include your name and email address so they can contact you if your usage causes issues. Requests without a User-Agent header may be rate-limited or blocked.
User-Agent: YourName [email protected]
In practice, any identifying string works. Requests from automated scripts without a User-Agent often fail with a 403 response. Always include this header.
Core API Endpoints
1. Company Submissions (Filing History)
Returns all metadata about a company's filings — what they filed, when, and accession numbers to access the documents.
Endpoint
GET https://data.sec.gov/submissions/CIK{CIK_PADDED}.json
| Parameter | Description |
|---|---|
CIK_PADDED | 10-digit Central Index Key with leading zeros. Apple = 0000320193 |
The response includes company name, SIC code, state of incorporation, and a filings object containing arrays of recent filings. Older filings may be in a separate paginated file referenced in the response.
2. XBRL Company Facts
Returns all structured financial data ever reported by a company in XBRL format — every line item from every 10-K and 10-Q, organized by taxonomy and concept.
Endpoint
GET https://data.sec.gov/api/xbrl/companyfacts/CIK{CIK_PADDED}.json
The response is a large JSON object containing all XBRL-tagged financial data. It is organized by taxonomy (typically us-gaap or ifrs-full), then by concept name (e.g., Revenues, NetIncomeLoss, Assets), then by units (USD, shares, etc.), then by individual reported values with filing dates and form types.
3. XBRL Company Concept
Returns data for a single XBRL concept across all periods — faster than companyfacts when you only need one metric.
Endpoint
GET https://data.sec.gov/api/xbrl/companyconcept/CIK{CIK_PADDED}/us-gaap/{CONCEPT}.json
| Parameter | Common Values |
|---|---|
CONCEPT | Revenues, NetIncomeLoss, Assets, Liabilities, EarningsPerShareBasic, CommonStockSharesOutstanding |
4. XBRL Frames (Cross-Company Data)
Returns a single XBRL concept for all companies that reported it in a specific period — useful for building comparative databases.
Endpoint
GET https://data.sec.gov/api/xbrl/frames/us-gaap/{CONCEPT}/{UNIT}/CY{YEAR}.json
For example, to get all companies' annual revenue for 2024: /api/xbrl/frames/us-gaap/Revenues/USD/CY2024.json
5. Company Search (EDGAR Full-Text Search)
To find a company's CIK by name or ticker, query the EDGAR company search:
CIK Lookup by Ticker
GET https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&company={NAME}&CIK=&type=10-K&dateb=&owner=include&count=10&search_text=&output=atom
For programmatic ticker-to-CIK lookups, the bulk CIK mapping file is the most reliable option:
Bulk CIK Mapping
GET https://www.sec.gov/files/company_tickers.json
This file contains all companies with their CIK, ticker, and name — small enough to download once and query locally.
Rate Limits
The EDGAR API enforces a rate limit of 10 requests per second per IP address. Exceeding this triggers a 429 response and may result in a temporary IP block. Best practices:
- Add a 100ms delay between requests in automated scripts
- Cache responses locally — company facts for a given company rarely change more than quarterly
- Use the bulk data downloads for large-scale analysis rather than hitting the API per-company
- Set a descriptive User-Agent so the SEC can contact you rather than block you
https://www.sec.gov/dera/data. The XBRL viewer and financial statements datasets contain preprocessed data that avoids needing thousands of individual API calls.Python Examples
Get Company Filing History
import requests
import time
HEADERS = {"User-Agent": "YourName [email protected]"}
def get_company_submissions(cik: str) -> dict:
"""Fetch all filing metadata for a company by CIK."""
cik_padded = str(cik).zfill(10)
url = f"https://data.sec.gov/submissions/CIK{cik_padded}.json"
r = requests.get(url, headers=HEADERS)
r.raise_for_status()
return r.json()
# Example: Apple (CIK 320193)
apple = get_company_submissions("320193")
print(apple["name"]) # Apple Inc.
print(apple["sic"]) # 3571 (Electronic Computers)
recent = apple["filings"]["recent"]
# Recent filings as parallel arrays
forms = recent["form"] # ["10-K", "10-Q", "8-K", ...]
dates = recent["filingDate"] # ["2024-11-01", ...]
accessions = recent["accessionNumber"]
Get Annual Revenue for a Company
def get_annual_revenue(cik: str) -> list:
"""Return annual revenue figures from 10-K filings."""
cik_padded = str(cik).zfill(10)
url = (
f"https://data.sec.gov/api/xbrl/companyconcept/"
f"CIK{cik_padded}/us-gaap/Revenues.json"
)
r = requests.get(url, headers=HEADERS)
r.raise_for_status()
data = r.json()
annual = [
item for item in data["units"]["USD"]
if item.get("form") == "10-K" and item.get("filed")
]
annual.sort(key=lambda x: x["end"], reverse=True)
return annual
revenue = get_annual_revenue("320193")
for row in revenue[:5]:
print(f"{row['end']}: ${row['val']:,.0f}")
Ticker to CIK Lookup
def build_ticker_map() -> dict:
"""Download and return a dict mapping ticker -> CIK."""
url = "https://www.sec.gov/files/company_tickers.json"
r = requests.get(url, headers=HEADERS)
r.raise_for_status()
data = r.json()
return {v["ticker"]: str(v["cik_str"]) for v in data.values()}
tickers = build_ticker_map()
msft_cik = tickers["MSFT"] # "789019"
JavaScript Example
const HEADERS = { "User-Agent": "YourName [email protected]" };
async function getCompanyFacts(cik) {
const cikPadded = String(cik).padStart(10, "0");
const url = `https://data.sec.gov/api/xbrl/companyfacts/CIK${cikPadded}.json`;
const res = await fetch(url, { headers: HEADERS });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
async function getNetIncome(cik) {
const facts = await getCompanyFacts(cik);
const concept = facts.facts?.["us-gaap"]?.NetIncomeLoss?.units?.USD ?? [];
return concept
.filter(d => d.form === "10-K")
.sort((a, b) => b.end.localeCompare(a.end));
}
// Usage
getNetIncome("320193").then(data => {
data.slice(0, 3).forEach(d => {
console.log(`${d.end}: $${(d.val / 1e9).toFixed(1)}B`);
});
});
Common Use Cases
| Use Case | Endpoint / Approach |
|---|---|
| Track a specific metric over time (revenue, EPS) | companyconcept with the relevant GAAP tag |
| Get all recent filings for a company | submissions endpoint, filter by form type |
| Compare a metric across all public companies | frames endpoint for a specific year |
| Read a specific filing document | Construct URL from accession number in submissions response |
| Find a company's CIK by ticker | company_tickers.json bulk file |
| Large-scale financial database | DERA bulk downloads (quarterly) |
Accessing Actual Filing Documents
To access the HTML or text of a specific filing (not just the metadata), construct the document URL from the accession number:
# Accession number format: 0001234567-24-000001
# Convert to path format: 0001234567-24-000001 -> 0001234567/24/000001
# Full URL:
# https://www.sec.gov/Archives/edgar/data/{CIK}/{ACCESSION_NO_DASHES}/{FILENAME}
def get_filing_index_url(cik, accession_number):
acc_clean = accession_number.replace("-", "")
return (
f"https://www.sec.gov/Archives/edgar/data/{cik}/"
f"{acc_clean}/{accession_number}-index.htm"
)
The filing index page lists all documents in the filing (10-K, exhibits, XBRL files). Parse this page to find the primary document URL.
For pre-summarized filing data without writing any code, search any company on TL;DR Filing to see key metrics pulled directly from SEC data. You can also browse all public companies or look up specific tickers to compare financial trends across filings.
Frequently Asked Questions
Is the SEC EDGAR API free?
Yes, completely free. No API key, no registration, no rate-limit tiers. The only requirement is the User-Agent header identifying yourself.
What is a CIK number?
CIK (Central Index Key) is the unique numeric identifier the SEC assigns to every filer. Apple's CIK is 320193, Microsoft's is 789019. Find any company's CIK using the company_tickers.json file or by searching EDGAR directly.
Why does companyfacts return empty data for some concepts?
Not all companies use the same XBRL tags. Try alternate tags — some use RevenueFromContractWithCustomerExcludingAssessedTax instead of Revenues. Check the companyfacts JSON to see which tags a specific company actually reports.
Can I get historical data going back before XBRL was required?
XBRL reporting became mandatory for large accelerated filers in 2009 and extended to all filers by 2011. Filings before that exist as text and HTML documents accessible through the Archives but not through the structured XBRL API endpoints.