
How to Scrape SEC EDGAR Data: Complete Guide for 2026
How to Scrape SEC EDGAR Data: Complete Guide for 2026 This guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeThis guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.
Run a live request from this page. No sign-up needed.
TL;DR
To scrape SEC EDGAR: Use AlterLab's API with Python or Node.js, start at T1 tier, let auto-escalation handle anti-bot protections, extract structured data via CSS selectors or Cortex AI, and respect rate limits. Typical cost is $0.002/request after initial attempts.
Why collect government data from SEC EDGAR?
SEC EDGAR hosts filings for all public U.S. companies. Practical uses include:
- Monitoring 10-K/10-Q filings for competitive intelligence on supply chain changes
- Tracking insider trading patterns (Form 4) to inform investment strategies
- Aggregating bankruptcy filings (Chapter 11) for distressed asset opportunities
Technical challenges
Government sites like sec.gov implement standard anti-bot protections: rate limiting by IP, User-Agent header validation, and occasional JavaScript challenges. Raw HTTP requests often fail with 403/429 responses. AlterLab's Smart Rendering API handles these via automatic proxy rotation, realistic browser fingerprints, and tier escalation—ensuring compliant access to public pages without bypassing security measures.
Quick start with AlterLab API
See the Getting started guide for setup. Here's how to scrape a sample SEC EDGAR page:
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_API_KEY")
response = client.scrape("https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm")
print(response["content"][:500]) # Preview first 500 charsimport { AlterLab } from "alterlab";
const client = new AlterLab({ apiKey: "YOUR_API_KEY" });
const response = await client.scrape({ url: "https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm" });
console.log(response.text.substring(0, 500));curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm"}'Extracting structured data
SEC EDGAR filing pages contain predictable patterns. For the Tesla 10-K example above:
- Company name:
<span class="companyName">Tesla Inc</span> - Filing date:
<div class="filingDate">2023-12-31</div> - Document type:
<input name="formType" value="10-K">
Extract with CSS selectors:
from alterlab import AlterLabSync
from parsel import Selector
client = AlterLabSync("YOUR_API_KEY")
html = client.scrape("https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm").text
selector = Selector(text=html)
data = {
"company": selector.css(".companyName::text").get(),
"date": selector.css(".filingDate::text").get(),
"form_type": selector.css('input[name="formType"]::attr(value)').get()
}
print(data)Structured JSON extraction with Cortex
For complex filings, use AlterLab's Cortex AI to extract typed JSON without CSS selectors:
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_API_KEY")
result = client.scrape(
url="https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm",
extraction_schema={
"type": "object",
"properties": {
"company_name": {"type": "string"},
"filing_date": {"type": "string", "format": "date"},
"total_assets": {"type": "number"},
"revenue": {"type": "number"},
"risk_factors": {"type": "array", "items": {"type": "string"}}
}
}
)
print(result["filtered_content"]) # Typed JSON outputCost breakdown
AlterLab's pricing adapts to page complexity. For SEC EDGAR:
- Most pages succeed at T3 (Stealth tier) after initial T1/T2 attempts
- You only pay for the tier that successfully retrieves the page
| Tier | Use Case | Cost per Request | Cost per 1,000 | Requests per $1 |
|---|---|---|---|---|
| T1 — Curl | Static HTML, no JS needed | $0.0002 | $0.20 | 5,000 |
| T2 — HTTP | Standard pages with headers | $0.0003 | $0.30 | 3,333 |
| T3 — Stealth | Protected pages, anti-bot active | $0.002 | $2.00 | 500 |
| T4 — Browser | Full JS rendering required | $0.004 | $4.00 | 250 |
| T5 — CAPTCHA | CAPTCHA solving + JS rendering | $0.02 | $20.00 | 50 |
View full pricing. Note: AlterLab auto-escalates tiers — start at T1 and the API promotes automatically if a lower tier fails. You only pay for the tier that succeeds.
Best practices
- Rate limiting: SEC EDGAR allows 10 requests/second per IP. AlterLab distributes requests across its proxy pool; add
delay: 100msbetween bursts if scraping aggressively. - robots.txt: Check
https://www.sec.gov/robots.txt—scraping/Archives/edgar/is permitted with crawl-delay=10 seconds. - Headers: AlterLab sends realistic browser headers by default. Override only if necessary (e.g., custom
Was this article helpful?
Frequently Asked Questions
Related Articles

Akamai Bot Manager Sensor Checks: Technical Guide
Learn how Akamai Bot Manager sensor checks work, why requests fail, and how ethical scraping pipelines use browser execution, sessions, and tiered requests.
Herald Blog Service

Scheduling Recurring Scrapes with Python and Cron
Learn how to schedule recurring scrapes with Python and cron, choose safe intervals, prevent duplicate runs, handle failures, and build reliable data pipelines.
Herald Blog Service

Job Listing Aggregation with Web Scraping
Build job listing aggregation with web scraping. Learn source discovery, extraction, normalization, deduplication, and refresh design for data engineers.
Herald Blog Service
Popular Posts
Recommended

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works in 2026
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works in 2026
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Anti-Bot Handling API
Automatic challenge handling for protected sites — works out of the box.
JavaScript Rendering API
Render SPAs and dynamic content with headless Chromium.
Pricing
5-tier pricing from $0.0002/page. Up to 5,000 free requests to start.
Documentation
API reference, SDKs, quickstart guides, and tutorials.
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.