Contents
Quick Start Response Format Database Schema Table Relationships Pre-built Queries (72 endpoints) Full-Text Search Cross-Dataset Queries Interactive Explore Pages Usage Guidelines

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

TableDescriptionRowsKey Columns
congress_membersCurrent and historical Congress members12,763bioguide_id, full_name, party, state, chamber, is_current
member_statsPre-computed activity counts per member12,763bioguide_id, trade_count, speech_count, bills_sponsored
stock_tradesCongressional stock trading disclosures95,621bioguide_id, ticker, transaction_date, transaction_type, amount_range
congressional_recordFloor speeches and proceedings878,583granule_id, date, title, chamber, full_text
crec_speakersSpeaker-to-speech mapping944,216granule_id, bioguide_id, speaker_name, party, state
crec_billsLinks speeches to legislation discussed1,561,719granule_id, bill_id, bill_type, bill_number
legislationBills and resolutions144,471bill_id, title, sponsor_bioguide_id, policy_area, cosponsor_count
legislation_cosponsorsBill cosponsors1,739,284bill_id, bioguide_id, is_original_cosponsor
legislation_subjectsPolicy subjects tagged to bills1,376,600bill_id, subject
legislation_actionsLegislative action timeline983,114bill_id, action_date, text, action_type
committeesCongressional committees233committee_id, name, chamber, url
committee_membershipsCommittee member assignments3,908bioguide_id, committee_id, title, rank

Regulatory Data

TableDescriptionRowsKey Columns
federal_registerFR documents (1994-present)993,703document_number, title, type, publication_date, agency_names, html_url
docketsRegulatory dockets86,706id, agency_id, title, docket_type
docket_summaryPre-computed docket stats26,195docket_id, comment_count, doc_count
documentsRegulatory documents within dockets727,510id, docket_id, agency_id, title, document_type, posted_date, comment_end_date
commentsPublic comments on regulations3.2Mid, docket_id, agency_id, submitter_name, submitter_type, organization, posted_date
fr_regs_crossrefLinks FR documents to Regulations.gov70,030fr_document_number, regs_document_id
presidential_documentsExecutive Orders & Proclamations5,904document_number, title, document_type, signing_date, executive_order_number
spending_awardsFederal contracts & grants (USASpending)175,504recipient_name, agency, sub_agency, award_amount, award_category, fiscal_year
cfr_sectionsCode of Federal Regulations55K+title_number, part_number, section_number, heading, content
agency_mapMaps agency codes across datasets5regs_code, fr_agency_name

Lobbying

TableDescriptionRowsKey Columns
lobbying_activitiesLobbying activity records with spending115,246filing_uuid, client_name, registrant_name, filing_year, issue_code, income_amount
lobbying_lobbyistsIndividual lobbyists (with revolving door data)194,151filing_uuid, lobbyist_name, covered_position
lobbying_filingsFiling metadata and reported amounts71,064filing_uuid, registrant_name, client_name, amount_reported, filing_year
lobbying_issue_codesIssue area code reference32code, description
lobbying_contributionsPolitical contributions by lobbyistslobbyist_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 TableSource TableIndexed Columns
federal_register_ftsfederal_registertitle, abstract, agency_names
dockets_ftsdocketstitle, agency_id
documents_ftsdocumentstitle
comments_ftscommentstitle, submitter_name, organization
crec_ftscongressional_recordtitle, full_text
cfr_ftscfr_sectionsheading, 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)

explore_member_search
Search members by name with stock trade, speech, and bill counts
Params: name (required) — GET /openregs/explore_member_search.json?name=Pelosi
explore_member_profile
Full member profile with activity counts
Params: bioguide_id
explore_member_trades
Stock trades for a specific member
Params: bioguide_id
explore_member_speeches
Floor speeches for a specific member
Params: bioguide_id
explore_member_bills
Legislation sponsored by a member
Params: bioguide_id
explore_docket_detail
Docket info with document and comment counts
Params: docket_id
explore_docket_documents
Documents in a specific docket
Params: docket_id
explore_docket_comments
Comment stats for a docket grouped by submitter type
Params: docket_id
explore_open_comments
Documents currently open for public comment
No params required
explore_lobbying_client
Search lobbying clients with spending totals
Params: name
explore_lobbying_activity
Lobbying activity records for a specific client
Params: client_name
explore_lobbying_lobbyists
Lobbyists working for a client (with revolving door positions)
Params: client_name
explore_lobbying_issues
All 32 lobbying issue areas with filing counts
No params required
explore_revolving_door
Lobbyists with prior government positions
No params required

Search endpoints (full-text search)

search_federal_register
Full-text search across Federal Register documents
Params: search
search_dockets
Full-text search across regulatory dockets
Params: search
search_comments
Full-text search across public comments
Params: search
search_congressional_record
Full-text search across floor speeches
Params: search
search_legislation
Search bills by title
Params: search
search_members
Search Congress members by name
Params: name
search_executive_orders
Search Executive Orders and Proclamations
Params: search
search_spending
Search federal spending awards by recipient
Params: search
search_cfr
Search Code of Federal Regulations
Params: search

Analysis endpoints

most_active_traders
Congress members ranked by number of stock trades
No params required
trades_by_ticker
All Congress members who traded a specific stock
Params: ticker
most_traded_stocks
Most frequently traded stocks across all of Congress
No params required
committee_trade_activity
Stock trades by committee members (useful for conflict-of-interest analysis)
Params: committee_id
most_commented_dockets
Regulatory dockets ranked by public comment volume
No params required
most_cosponsored_bills
Bills with the most cosponsors
No params required
bipartisan_bills
Bills with cross-party cosponsorship
No params required
top_contractors
Top federal contractors by award amount
No params required
spending_by_agency
Federal spending broken down by agency
No params required
executive_orders
All Executive Orders (most recent first)
No params required
rulemaking_pipeline
Track regulations from proposed rule to final rule
No params required

Lookup endpoints

member_profile
Comprehensive member profile: trades, speeches, and bills
Params: bioguide_id
committee_members
Members of a specific committee
Params: committee_id
member_committees
Committees a member serves on
Params: bioguide_id
bill_cosponsors
All cosponsors of a specific bill
Params: bill_id (e.g., 118-hr-3684)
floor_debate_for_bill
Congressional Record entries discussing a specific bill
Params: bill_id (e.g., 118-hr-3684)
comments_for_docket
Public comments for a specific regulatory docket
Params: docket_id
cross_reference
Find linked Federal Register and Regulations.gov documents
Params: fr_doc_number and/or regs_doc_id (provide one or both)
executive_order_lookup
Look up a specific Executive Order by number
Params: eo_number (e.g., 14067)

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:

PageDescriptionFeatures
MembersCongress member profilesSearch, stock trades, floor speeches, legislation, committees, ticker drill-down, cosponsors
RegulationsRegulatory lifecycle explorerDockets, FR docs, comments, open periods, agencies, executive orders, policy areas
LobbyingLobbying disclosure explorerClients, firms, issue areas, revolving door, spending crossover
EntityCross-dataset entity searchSearch any name across lobbying, spending, trades, regulations, legislation

Usage guidelines

This API is free and open. We ask that you:

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: