Legal & Public Records
Public-records data without the provider SDKs: U.S. court dockets (CourtListener), SEC EDGAR filings + Form 4 insider trades, and OFAC SDN sanctions screening. All backed by free public sources.
What it scrapes
| Source | Data |
|---|---|
| CourtListener (free API) | Full-text docket search across U.S. federal courts; single-docket detail by CourtListener id |
| SEC EDGAR (public XML) | Filing search by ticker + form type (default 8-K); recent Form 4 insider-transaction filings per ticker |
| OFAC SDN list | Name screening against the Specially Designated Nationals and Blocked Persons list |
Endpoints
Router: routers/legal_docs.py · tag: Legal & Public Records
| Method | Path | Summary |
|---|---|---|
| GET | /v1/legal/dockets/search | Full-text docket search (query, limit 1–100, default 20) |
| GET | /v1/legal/dockets/{docket_id} | Single docket by CourtListener integer id |
| GET | /v1/legal/sec/search | EDGAR filing search (ticker, form_type default 8-K, limit 1–100, default 20) |
| GET | /v1/legal/sec/insider/{ticker} | Recent Form 4 insider trades (limit 1–100, default 20) |
| GET | /v1/legal/sanctions/{name} | OFAC SDN name screening |
GET /v1/legal/dockets/search
Query params: query (required, max 500 chars), limit (1–100, default 20).
curl -X GET "http://localhost:8005/v1/legal/dockets/search?query=securities%20fraud&limit=5" \
-H "Authorization: Bearer <key>"
Response (200):
{
"success": true,
"query": "securities fraud",
"data": [
{
"id": 1234567,
"case_name": "SEC v. Example Corp",
"court": "S.D.N.Y.",
"date_filed": "2026-07-01",
"docket_number": "1:26-cv-01234",
"url": "https://www.courtlistener.com/docket/1234567/"
}
]
}
GET /v1/legal/dockets/{docket_id}
curl -X GET "http://localhost:8005/v1/legal/dockets/1234567" \
-H "Authorization: Bearer <key>"
Response (200): full docket detail — parties, attorneys, filings timeline, and documents.
GET /v1/legal/sec/search
Query params: ticker (required, max 10 chars), form_type (default
8-K), limit (1–100, default 20).
curl -X GET "http://localhost:8005/v1/legal/sec/search?ticker=AAPL&form_type=8-K&limit=5" \
-H "Authorization: Bearer <key>"
Response (200):
{
"success": true,
"ticker": "AAPL",
"form_type": "8-K",
"data": [
{
"accession_number": "0000320193-26-000123",
"form_type": "8-K",
"filing_date": "2026-08-10",
"description": "Current report — results of operations",
"url": "https://www.sec.gov/Archives/edgar/data/320193/..."
}
]
}
GET /v1/legal/sec/insider/{ticker}
curl -X GET "http://localhost:8005/v1/legal/sec/insider/AAPL?limit=5" \
-H "Authorization: Bearer <key>"
Response (200):
{
"success": true,
"ticker": "AAPL",
"data": [
{
"filing_date": "2026-08-14",
"insider_name": "Timothy D. Cook",
"title": "Chief Executive Officer",
"transaction_type": "SALE",
"shares": 50000,
"value": 11500000,
"url": "https://www.sec.gov/Archives/edgar/data/320193/..."
}
]
}
GET /v1/legal/sanctions/{name}
curl -X GET "http://localhost:8005/v1/legal/sanctions/Example%20Entity" \
-H "Authorization: Bearer <key>"
Response (200):
{
"success": true,
"name": "Example Entity",
"data": {
"matched": true,
"matches": [
{
"name": "EXAMPLE ENTITY",
"type": "Entity",
"programs": ["SDGT"],
"addresses": ["Iran"],
"remark": "Specially Designated Global Terrorist"
}
]
}
}
MCP tools
There is no dedicated MCP tool for the legal endpoints yet — use them
directly via REST. For AI-agent workflows, pry_scrape can pull any public
court/SEC page and pry_extract can structure it.
Who uses this
- Compliance & AML teams — OFAC screening as a pre-onboarding / pre-transaction check.
- Investigative journalists — docket search across courts and insider trade timelines.
- Quant / equity research — Form 4 insider-trade signals as an input to trading models.
- Legal tech — case monitoring pipelines that diff dockets over time.
Next steps
- Crypto Market — related token-level risk screening
- Compliance API — GDPR/CCPA compliance checks for your own scrapes
- Monitoring — watch docket/filing pages for changes