
How to Scrape SEC EDGAR Data: Complete Guide for 2026
Learn how to scrape SEC EDGAR for public financial data using AlterLab's API with Python and Node.js. Covers anti-bot handling, structured extraction, and cost-effective scaling.
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.
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:
import alterlab
client = alterlab.Client("YOUR_API_KEY")
response = client.scrape("https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm")
print(response.text[:500]) # Preview first 500 charsimport { AlterLab } from "alterlab";
const client = new AlterLab({ apiKey: "YOUR_API_KEY" });
const response = await client.scrape("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" \
-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:
import alterlab
from parsel import Selector
client = alterlab.Client("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:
import alterlab
client = alterlab.Client("YOUR_API_KEY")
result = client.extract(
url="https://www.sec.gov/Archives/edgar/data/320193/000032019323000108/tsla-20231231.htm",
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.data) # 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

How to Scrape Yellow Pages Data: Complete Guide for 2026
<meta description>
Herald Blog Service

Engineering Update: Billing Identity and Deployment Fixes
We've implemented a new billing identity API, fixed Stripe webhook ordering gaps, and resolved deployment configuration bugs in our latest engineering update.
Herald Blog Service

Understanding Anti-Bot Detection: Fingerprinting, CAPTCHAs, and Rate Limits
Learn how anti-bot mechanisms like browser fingerprinting, CAPTCHAs, and rate limiting work. Understand the technical layers of bot detection for data pipelines.
Herald Blog Service
Popular Posts
Recommended
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

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

AlterLab vs Firecrawl: Which Scraping API Is Better in 2026?

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites 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. 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.