HTTP API Guide¶
REST endpoints for filings, sections, metrics, scores, flags, changes, and batch panel screening.
Audience: Backend developers integrating the REST API.
Before you start: pip install "disclosure-alpha[api]" (see Installation) and SEC EDGAR Setup.
Typical journeys¶
Dashboard headline —
GET /v1/company/{ticker}/disclosure-matrix?tier=liteforoverall_disclosure_risk_scoreonlyResearch workflow —
tier=standardfor overall + component scores with metrics attachedAudit / debugging —
tier=analystwithinclude=metrics,provenancefor full score breakdown and input provenance
Interpret matrix JSON using Understanding Scores.
Security
The local API server has no built-in authentication. Do not expose it publicly without your own gateway. See Production Notes.
Annotated matrix response¶
Scores block from the committed minimal 10-K fixture (same shape as /disclosure-matrix):
"extraction_confs": [
0.35,
0.35
],
"diff_confs": [
0.2,
0.2
],
"extraction_warnings": [],
"required_sections_present": true,
"has_prior": false
},
"scores": {
"overall_disclosure_risk_score": 33.159052,
"score_coverage_ratio": 0.7778,
"confidence_score": 0.3426,
"missing_components": [
"disclosure_change_score",
"event_severity_score"
],
"components": {
"risk_factor_intensity_score": 60.0,
overall_disclosure_risk_score— headline 0–100 for sorting and dashboardsscore_coverage_ratio/missing_components— data quality before comparing tickerscomponents— ten computed scores (nine headline-weighted plusspecificity_quality_score); null means not computed (not zero)
With tier=lite, only the headline field is returned. With tier=analyst, add metrics and provenance arrays.
Endpoint map¶
Product |
Method |
Path |
Use when… |
|---|---|---|---|
Health |
|
|
…checking the server is up before batch jobs |
Filing Index |
|
|
…listing available filings for a ticker |
Section Extractor |
|
|
…debugging extraction or fetching section text |
Disclosure Analytics |
|
|
…you need raw metrics, flags, and diffs without aggregation |
Disclosure Risk Score |
|
|
…you need filing-level component scores for one ticker |
Risk Flags |
|
|
…boolean risk events only |
Filing Changes |
|
|
…year-over-year diff details without full scores |
Panel Screener |
|
|
…batch-screening up to 25 tickers |
Shared query params on ticker routes: fiscal_year, form_type, quarter (10-Q), compare (prior|none), sections (comma-separated filter).
Start the server¶
export SEC_USER_AGENT="YourName your@email.com"
disclosure-alpha-api
# listens on 0.0.0.0:8000 (override with HOST / PORT env)
Response tiers (matrix only)¶
Optional tier query param overrides include and fields:
Tier |
|
|
Use case |
|---|---|---|---|
|
(empty) |
|
Dashboard headline score |
|
|
|
Research workflow |
|
|
all |
Audit / debugging |
Shared query params (sections, disclosure-metrics, disclosure-matrix):
Param |
Default |
Description |
|---|---|---|
|
|
|
|
all |
Comma-separated section names; on disclosure-matrix, filters both returned metrics and computed scores (not filing-level scores from unfiltered sections). Panel has no section filter. |
Matrix-only params:
Param |
Default |
Description |
|---|---|---|
|
— |
|
|
|
Comma-set: |
|
all |
Slim scores, e.g. |
|
|
Legacy |
Example requests¶
curl "http://localhost:8000/v1/company/AAPL/disclosure-matrix?fiscal_year=2025&form_type=10-K"
curl "http://localhost:8000/v1/company/AAPL/disclosure-matrix?fiscal_year=2025&include="
curl "http://localhost:8000/v1/company/AAPL/disclosure-metrics?fiscal_year=2025&form_type=10-K&compare=none"
curl "http://localhost:8000/v1/company/AAPL/sections?fiscal_year=2025§ions=item_1a_risk_factors"
Panel batch semantics¶
Max 25 tickers per request (422 if exceeded).
Per-ticker errors collected (
status: error); request does not fail-fast.Optional
scoring_model_versionin request body (defaultdeterministic_scoring_v2; legacydeterministic_scoring_v1).
Sample panel response: Examples Gallery.
Postman collections¶
Import-ready collections and response examples: Examples Gallery.
OpenAPI¶
With disclosure-alpha-api running:
Swagger UI:
http://localhost:8000/docsOpenAPI JSON:
http://localhost:8000/openapi.json
Endpoint reference (generated from schema): HTTP Endpoint Reference. Status codes: HTTP API (OpenAPI).
HTTP errors¶
Code |
Cause |
|---|---|
404 |
Filing not found for ticker / year / form |
422 |
Invalid body (e.g. panel with >25 tickers) |