Quick start
The OpenRegs API is powered by Datasette. You can run arbitrary SQL queries or use pre-built canned queries with parameters.
Base URL
https://regs.datadawn.org/openregs
Example: Search for a Congress member
curl "https://regs.datadawn.org/openregs.json?sql=SELECT+bioguide_id,full_name,party,state,chamber+FROM+congress_members+WHERE+full_name+LIKE+'%25Pelosi%25'&_shape=objects"
Example: Get open comment periods
curl "https://regs.datadawn.org/openregs.json?sql=SELECT+id,agency_id,title,comment_end_date+FROM+documents+WHERE+comment_end_date>datetime('now')+AND+withdrawn=0+ORDER+BY+comment_end_date+LIMIT+10&_shape=objects"
Example: Top lobbying clients
curl "https://regs.datadawn.org/openregs.json?sql=SELECT+client_name,SUM(income_amount)+AS+total+FROM+lobbying_activities+GROUP+BY+client_name+ORDER+BY+total+DESC+LIMIT+10&_shape=objects"
Response format
All endpoints return JSON. Add _shape=objects to get rows as an array of objects (recommended). Without it, rows come as arrays.
Pagination
Default limit is 1000 rows (configurable up to 1000). Use LIMIT and OFFSET in SQL, or _size and _next for table endpoints.
CORS
CORS is enabled for all origins. You can call the API directly from browser JavaScript.
Response shape
{
"ok": true,
"rows": [
{"bioguide_id": "P000197", "full_name": "Nancy Pelosi", "party": "Democrat", ...},
...
],
"truncated": false
}
Database schema
The openregs database contains all data in one place. Here are the primary tables:
Congress & Members
| Table | Description | Rows | Key Columns |
|---|---|---|---|
| congress_members | Current and historical Congress members | 12,763 | bioguide_id, full_name, party, state, chamber, is_current |
| member_stats | Pre-computed activity counts per member | 12,763 | bioguide_id, trade_count, speech_count, bills_sponsored |
| stock_trades | Congressional stock trading disclosures | 95,621 | bioguide_id, ticker, transaction_date, transaction_type, amount_range |
| congressional_record | Floor speeches and proceedings | 878,583 | granule_id, date, title, chamber, full_text |
| crec_speakers | Speaker-to-speech mapping | 944,216 | granule_id, bioguide_id, speaker_name, party, state |
| crec_bills | Links speeches to legislation discussed | 1,561,719 | granule_id, bill_id, bill_type, bill_number |
| legislation | Bills and resolutions | 144,471 | bill_id, title, sponsor_bioguide_id, policy_area, cosponsor_count |
| legislation_cosponsors | Bill cosponsors | 1,739,284 | bill_id, bioguide_id, is_original_cosponsor |
| legislation_subjects | Policy subjects tagged to bills | 1,376,600 | bill_id, subject |
| legislation_actions | Legislative action timeline | 983,114 | bill_id, action_date, text, action_type |
| committees | Congressional committees | 233 | committee_id, name, chamber, url |
| committee_memberships | Committee member assignments | 3,908 | bioguide_id, committee_id, title, rank |
Regulatory Data
| Table | Description | Rows | Key Columns |
|---|---|---|---|
| federal_register | FR documents (1994-present) | 993,703 | document_number, title, type, publication_date, agency_names, html_url |
| dockets | Regulatory dockets | 86,706 | id, agency_id, title, docket_type |
| docket_summary | Pre-computed docket stats | 26,195 | docket_id, comment_count, doc_count |
| documents | Regulatory documents within dockets | 727,510 | id, docket_id, agency_id, title, document_type, posted_date, comment_end_date |
| comments | Public comments on regulations | 3.2M | id, docket_id, agency_id, submitter_name, submitter_type, organization, posted_date |
| fr_regs_crossref | Links FR documents to Regulations.gov | 70,030 | fr_document_number, regs_document_id |
| presidential_documents | Executive Orders & Proclamations | 5,904 | document_number, title, document_type, signing_date, executive_order_number |
| spending_awards | Federal contracts & grants (USASpending) | 175,504 | recipient_name, agency, sub_agency, award_amount, award_category, fiscal_year |
| cfr_sections | Code of Federal Regulations | 55K+ | title_number, part_number, section_number, heading, content |
| agency_map | Maps agency codes across datasets | 5 | regs_code, fr_agency_name |
Lobbying
| Table | Description | Rows | Key Columns |
|---|---|---|---|
| lobbying_activities | Lobbying activity records with spending | 115,246 | filing_uuid, client_name, registrant_name, filing_year, issue_code, income_amount |
| lobbying_lobbyists | Individual lobbyists (with revolving door data) | 194,151 | filing_uuid, lobbyist_name, covered_position |
| lobbying_filings | Filing metadata and reported amounts | 71,064 | filing_uuid, registrant_name, client_name, amount_reported, filing_year |
| lobbying_issue_codes | Issue area code reference | 32 | code, description |
| lobbying_contributions | Political contributions by lobbyists | — | lobbyist_name, recipient_name, amount, contribution_date |
Full-Text Search Indexes
FTS5 indexes are available for fast keyword search. Join to source tables via rowid:
| FTS Table | Source Table | Indexed Columns |
|---|---|---|
| federal_register_fts | federal_register | title, abstract, agency_names |
| dockets_fts | dockets | title, agency_id |
| documents_fts | documents | title |
| comments_fts | comments | title, submitter_name, organization |
| crec_fts | congressional_record | title, full_text |
| cfr_fts | cfr_sections | heading, content |
Table relationships
Key join paths for cross-dataset queries. All joins use indexed columns.
Congress member hub
congress_members.bioguide_id ├── stock_trades.bioguide_id (trades) ├── crec_speakers.bioguide_id (speeches) ├── legislation.sponsor_bioguide_id (sponsored bills) ├── legislation_cosponsors.bioguide_id (cosponsored bills) ├── committee_memberships.bioguide_id (committees) └── member_stats.bioguide_id (pre-computed counts)
Legislation hub
legislation.bill_id
├── legislation_cosponsors.bill_id (cosponsors)
├── legislation_subjects.bill_id (policy subjects)
├── legislation_actions.bill_id (action timeline)
└── crec_bills.bill_id (floor speeches about this bill)
└── congressional_record.granule_id (speech text)
Regulatory lifecycle
dockets.id
├── documents.docket_id (regulatory documents)
│ └── fr_regs_crossref.regs_document_id → federal_register (FR links)
└── comments.docket_id (public comments)
documents.comment_end_date (open comment periods: WHERE > datetime('now'))
Lobbying chain
lobbying_activities.filing_uuid ├── lobbying_lobbyists.filing_uuid (who lobbied) │ └── covered_position (revolving door: former gov't roles) └── lobbying_issue_codes.code = lobbying_activities.issue_code Group by client_name for client view, registrant_name for firm view
Pre-built queries
72 pre-built endpoints with named parameters and optimized SQL. Use .json suffix for JSON output. All accept _shape=objects.
Explore endpoints (used by interactive UI)
GET /openregs/explore_member_search.json?name=PelosiSearch endpoints (full-text search)
Analysis endpoints
Lookup endpoints
Full list of all 72 endpoints available at /openregs (Datasette homepage).
Full-text search
FTS5 tables support phrase matching, boolean operators, and ranking. Join the FTS table to the source table via rowid.
Basic phrase search
SELECT d.id, d.title, d.agency_id FROM dockets_fts JOIN dockets d ON d.rowid = dockets_fts.rowid WHERE dockets_fts MATCH '"clean water"' ORDER BY rank LIMIT 20
Boolean operators
-- AND (default): both terms must appear MATCH 'climate change' -- OR: either term MATCH 'climate OR environment' -- NOT: exclude a term MATCH 'emissions NOT carbon' -- Phrase: exact phrase match MATCH '"net neutrality"'
Search comments with submitter info
SELECT c.id, c.title, c.submitter_name, c.docket_id, c.posted_date FROM comments_fts JOIN comments c ON c.rowid = comments_fts.rowid WHERE comments_fts MATCH '"endangered species"' ORDER BY rank LIMIT 20
Cross-dataset queries
The real power of OpenRegs is connecting data across datasets. Here are some useful patterns:
Who in Congress trades a stock, and what do they oversee?
SELECT cm.full_name, cm.party, cm.state, st.ticker,
COUNT(*) AS trades, c.name AS committee
FROM stock_trades st
JOIN congress_members cm ON cm.bioguide_id = st.bioguide_id
LEFT JOIN committee_memberships cmm ON cmm.bioguide_id = cm.bioguide_id
LEFT JOIN committees c ON c.committee_id = cmm.committee_id
WHERE st.ticker = 'MSFT'
GROUP BY cm.bioguide_id, c.committee_id
ORDER BY trades DESC LIMIT 20
Entity search: find any organization across all datasets
-- Lobbying spending SELECT client_name, SUM(income_amount) AS total FROM lobbying_activities WHERE client_name LIKE '%Boeing%' GROUP BY client_name; -- Federal contracts SELECT recipient_name, SUM(award_amount) AS total, COUNT(*) AS awards FROM spending_awards WHERE recipient_name LIKE '%Boeing%' GROUP BY recipient_name; -- Regulations mentioning them SELECT d.id, d.title, d.agency_id FROM dockets_fts JOIN dockets d ON d.rowid = dockets_fts.rowid WHERE dockets_fts MATCH 'Boeing' LIMIT 10;
Which bills were discussed most on the floor?
SELECT l.bill_id, l.title, l.policy_area,
COUNT(DISTINCT cb.granule_id) AS floor_mentions
FROM crec_bills cb
JOIN legislation l ON l.bill_id = cb.bill_id
GROUP BY cb.bill_id
ORDER BY floor_mentions DESC LIMIT 20
Revolving door: lobbyists with government experience by client
SELECT la.client_name, ll.lobbyist_name, ll.covered_position, la.filing_year FROM lobbying_lobbyists ll JOIN lobbying_activities la ON la.filing_uuid = ll.filing_uuid WHERE ll.covered_position IS NOT NULL AND ll.covered_position != '' AND la.client_name LIKE '%Pfizer%' ORDER BY la.filing_year DESC
Interactive explore pages
If you prefer a visual interface, these pages provide full-featured search, filtering, and drill-down across all datasets:
| Page | Description | Features |
|---|---|---|
| Members | Congress member profiles | Search, stock trades, floor speeches, legislation, committees, ticker drill-down, cosponsors |
| Regulations | Regulatory lifecycle explorer | Dockets, FR docs, comments, open periods, agencies, executive orders, policy areas |
| Lobbying | Lobbying disclosure explorer | Clients, firms, issue areas, revolving door, spending crossover |
| Entity | Cross-dataset entity search | Search any name across lobbying, spending, trades, regulations, legislation |
Usage guidelines
This API is free and open. We ask that you:
- • Be reasonable with query volume (no rapid-fire bulk scraping)
- • Use
LIMITto cap results when exploring - • Prefer canned queries for common operations (they're parameterized and optimized)
- • Attribute DataDawn if sharing results publicly (appreciated, not required)
- • All data is U.S. government public domain — no copyright restrictions
Rate Limits
Queries have a 10-second timeout. Maximum 1000 rows per response. No authentication required.
For AI Agents
This page includes structured application/ld+json metadata with complete table schemas, row counts, foreign keys, and FTS index descriptions. Recommended approach:
- • Start with canned queries (72 pre-built endpoints) before writing raw SQL
- • Use
member_statsanddocket_summarytables for counts instead of COUNT(*) subqueries - • Use FTS tables for keyword search (much faster than LIKE '%...%')
- • Join across datasets via
bioguide_id(members),docket_id(regulations),filing_uuid(lobbying) - • Always use
&_shape=objectsfor structured JSON output - • Discover all endpoints at
/openregs.json(Datasette metadata)