Monitoring democratic institutions through public records
Democracy Monitor is open data. All assessment results, source documents, and computed metrics are available for download and programmatic access.
One row per category-week with flattened structural, AI, thematic, and concern metrics.
Download CSVOne row per scored document with keyword matches, severity scores, and document class.
Download CSVEvery column in both CSVs is documented in the data dictionary.
Document counts for the court-record categories are computed from a single documented counting rule applied uniformly to all periods (the counting_scope flag in the documents table), so they are directly comparable across the February 2026 collection change.
For developers and researchers who need the complete dataset, a PostgreSQL dump is available for download. The dump is a single pg_dump -Fc file including all tables (~6 GB): source documents, AI assessments, weekly aggregates, baselines, narratives, vector embeddings, and the tracked federal litigation cases (tracked_cases — one row per case with court, filing/termination dates, and category routing; as of August 2026 this table replaces the ~283,000 docket-entry stub rows formerly in documents). Updated weekly.
Column-level documentation for all seven tables is in the data dictionary.
| Table | Description |
|---|---|
| documents | Source documents with metadata, content, source type. counting_scope = false marks judicial opinions outside the documented counting population (v1 classifier: SCOTUS; circuits/D.D.C. on executive-power phrases) — stored and assessed, but excluded from counts and statistics for cross-era consistency |
| ai_document_assessments | Per-document AI review (P1 flag, P2 classification, reasoning, prompt_version) |
| weekly_aggregates | Category-week rollups with structural/AI/thematic/concern scores |
| baselines | Historical baseline statistics (eight cycle-year periods: Trump 2017–2020, Biden 2021–2024) |
| narratives | AI-generated weekly and term summaries |
| document_scores | Per-document keyword assessment scores |
| tracked_cases | Federal litigation case tracker: one row per case (cl:<docketId>, joinable to documents.case_id) with court, filing/termination dates, status, posture, and category routing |
# Automatic (recommended)
createdb democracy_monitor
pnpm db:init --force
# Manual
curl -LO https://democracymonitor.us/api/data/dump
pg_restore --clean --if-exists --no-owner -d democracy_monitor dump
pnpm db:migrate
See DEPLOYMENT.md for full setup instructions. Schema is defined in lib/db/schema.ts.
| Endpoint | Params | Description |
|---|---|---|
| /api/export/weekly | format (csv|json), category, from, to | Weekly aggregate data per category with structural/AI/thematic scores |
| /api/export/scores | format (csv|json), category, from, to | Per-document keyword assessment scores with match details |
All endpoints default to JSON. Add ?format=csv for CSV output with flattened columns (no JSON blobs).
Full field-level documentation for both CSV exports — every column's meaning, derivation, and caveats — lives in the data dictionary (machine-readable at /api/export/dictionary). The dictionary is generated from the same registry the export code is tested against, so it cannot drift from the actual columns.
Export endpoints are rate-limited to 1 request per second per IP address. Responses include a Retry-After header when throttled.