Skip to content

US Congress

Members since 1789, roll-call votes, bills and laws of the US Congress, keyed on bioguide ID

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/us-congress/index.md to help me query US Congress with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

The most common outcomes of Senate roll calls in the 118th Congress

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT vote_result, count(*) AS votes
FROM us_congress.main.rollcalls(118, chamber := 'senate')
GROUP BY vote_result
ORDER BY votes DESC
LIMIT 5

Quick start

Choose where to run US Congress, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'us_congress' AS us_congress (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-us-congress-worker'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

us_congress credentials

Congress.gov API key (a free api.data.gov key) for the bill, law, committee and House vote functions.

Get these credentials →
secret.sql
CREATE SECRET us_congress (
    TYPE us_congress,
    api_key '<US_CONGRESS_API_KEY>'  -- secret
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT vote_result, count(*) AS votes
FROM us_congress.main.rollcalls(118, chamber := 'senate')
GROUP BY vote_result
ORDER BY votes DESC
LIMIT 5
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'us_congress' AS us_congress (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-us-congress-worker'
);

Overview

US Congress lawmaking as SQL: members of Congress since 1789 keyed by bioguide ID, their terms and DW-NOMINATE ideology, House and Senate roll-call votes back to the 1st Congress, and bills, laws, amendments, committees, nominations and treaties from Congress.gov.

ATTACH options

cache_dir
Directory for downloaded bulk files; defaults to the per-user cache directory.VARCHAR
cache_ttl_hours
Hours a cached file is used before it is revalidated upstream (default 24).DOUBLE
congress_gov_url
Congress.gov API root (default https://api.congress.gov/v3).VARCHAR
legislators_url
congress-legislators file root (default https://unitedstates.github.io/congress-legislators).VARCHAR
voteview_url
Voteview data root (default https://voteview.com/static/data/out).VARCHAR
senate_url
Senate LIS roll-call XML root (default https://www.senate.gov/legislative/LIS).VARCHAR

Catalog

Everything us_congress exposes once attached — read straight from the worker's released build.

us_congress 1 schema
main 3 tables · 23 functions

Members of Congress, roll-call votes and legislation, keyed on bioguide_id; the member and vote relations need no key, the Congress.gov relations need an API key secret.

Schema examples (23)
Examples (23)

The most common outcomes of Senate roll calls in the 118th Congress

SELECT vote_result, count(*) AS votes
FROM us_congress.main.rollcalls(118, chamber := 'senate')
GROUP BY vote_result
ORDER BY votes DESC
LIMIT 5;

Senators who missed the most roll calls in the 118th Congress

SELECT bioguide_id, count(*) FILTER (WHERE vote = 'Not Voting') AS missed,
  count(*) AS votes
FROM us_congress.main.member_votes(118, chamber := 'senate')
GROUP BY bioguide_id
ORDER BY missed DESC
LIMIT 5;

Party medians on the first DW-NOMINATE dimension in the 118th House

SELECT party_name, round(median(nominate_dim1), 3) AS median_dim1
FROM us_congress.main.member_ideology(118, chamber := 'house')
GROUP BY party_name
ORDER BY median_dim1;

The last ten Senate votes of 2025

SELECT vote_number, vote_date, question, result, yeas, nays
FROM us_congress.main.senate_votes(119, 1)
ORDER BY vote_number DESC
LIMIT 10;
19 more examples

The party breakdown of the first Senate vote of 2025

SELECT party, vote_cast, count(*) AS senators
FROM us_congress.main.senate_vote_positions(119, 1, 1)
GROUP BY party, vote_cast
ORDER BY party, vote_cast;

What a paired yea is called

SELECT us_congress.main.vote_cast_label(2) AS label;

The ten House joint resolutions of the 118th Congress with the most recent action

SELECT bill_id, title, latest_action_date
FROM us_congress.main.bills(congress := 118, bill_type := 'hjres')
ORDER BY latest_action_date DESC
LIMIT 10;

Who sponsored H.R. 2882 (118th) and whether it became law

SELECT title, sponsor_bioguide_id, policy_area, became_law, law_numbers
FROM us_congress.main.bill(118, 'hr', 2882);

The recorded votes on H.R. 2882 (118th)

SELECT action_date, action_type, action_text
FROM us_congress.main.bill_actions(118, 'hr', 2882)
WHERE vote_roll_number IS NOT NULL
ORDER BY action_date;

Cosponsors of H.R. 2882 (118th) by party

SELECT party, count(*) AS cosponsors
FROM us_congress.main.bill_cosponsors(118, 'hr', 2882)
WHERE sponsorship_withdrawn_date IS NULL
GROUP BY party
ORDER BY party;

The first 20 subject terms of H.R. 2882 (118th)

SELECT subject
FROM us_congress.main.bill_subjects(118, 'hr', 2882)
WHERE NOT is_policy_area
ORDER BY subject
LIMIT 20;

The summary versions of H.R. 2882 (118th)

SELECT action_date, action_desc, length(summary_html) AS chars
FROM us_congress.main.bill_summaries(118, 'hr', 2882)
ORDER BY action_date;

The text versions of H.R. 2882 (118th) in order

SELECT version_type, version_date, pdf_url
FROM us_congress.main.bill_text_versions(118, 'hr', 2882)
ORDER BY version_date NULLS LAST;

How many public and private laws the 118th Congress enacted

SELECT law_type, count(*) AS laws
FROM us_congress.main.laws(118)
GROUP BY law_type
ORDER BY law_type;

Ten recently updated Senate amendments of the 118th Congress

SELECT amendment_number, purpose, latest_action_text
FROM us_congress.main.amendments(congress := 118, amendment_type := 'samdt')
LIMIT 10;

California's delegation in the 118th Congress by party

SELECT party_name, count(*) AS members
FROM us_congress.main.congress_gov_members(congress := 118, state := 'CA')
GROUP BY party_name
ORDER BY members DESC;

The five policy areas Senator Schumer has sponsored the most bills in

SELECT policy_area, count(*) AS bills
FROM us_congress.main.sponsored_legislation('S000148')
WHERE bill_id IS NOT NULL
GROUP BY policy_area
ORDER BY bills DESC
LIMIT 5;

How many bills Senator Schumer cosponsored in each of the last five Congresses

SELECT congress, count(*) AS bills
FROM us_congress.main.cosponsored_legislation('S000148')
GROUP BY congress
ORDER BY congress DESC
LIMIT 5;

The Senate's full committees in the 118th Congress

SELECT system_code, name, subcommittee_count
FROM us_congress.main.committees(congress := 118, chamber := 'senate')
WHERE parent_system_code IS NULL
ORDER BY name;

Organizations with the most civilian nominations in the 118th Congress

SELECT organization, count(*) AS nominations
FROM us_congress.main.nominations(congress := 118)
WHERE is_civilian
GROUP BY organization
ORDER BY nominations DESC
LIMIT 10;

Treaties received in the 117th Congress

SELECT number, topic, transmitted_date
FROM us_congress.main.treaties(congress := 117)
ORDER BY transmitted_date;

Outcomes of House roll calls in 2023

SELECT result, count(*) AS votes
FROM us_congress.main.house_votes(118, session := 1)
GROUP BY result
ORDER BY votes DESC;

The party split on House roll call 296 of 2023

SELECT party, vote_cast, count(*) AS members
FROM us_congress.main.house_vote_positions(118, 1, 296)
GROUP BY party, vote_cast
ORDER BY party, vote_cast;
Tables
cache_files 2 examples8 cols

The bulk files (legislators, Voteview, Senate XML) this worker has downloaded, with source and freshness.

Columns
cache_dir VARCHAR
The cache directory in use (ATTACH option cache_dir, or the per-user default).
pathnot null VARCHAR
Absolute path of the cached file.
url VARCHAR
Upstream URL the file was downloaded from.
bytes BIGINT
File size in bytes.
fetched_at TIMESTAMP WITH TIME ZONE
When the file was last downloaded or revalidated.
etag VARCHAR
Upstream ETag, used to revalidate after the TTL.
last_modified VARCHAR
Upstream Last-Modified header.
sha256 VARCHAR
SHA-256 of the downloaded bytes.
ConstraintsPRIMARY KEY (path)
Examples (2)

Cached files, largest first

SELECT url, bytes, fetched_at
FROM us_congress.main.cache_files
ORDER BY bytes DESC;

How much disk the cache uses

SELECT count(*) AS files, coalesce(sum(bytes), 0) AS total_bytes
FROM us_congress.main.cache_files;
Link
member_terms 2 examples18 cols

Every term served in the House or Senate since 1789: chamber, dates, state, district and party.

Columns
bioguide_idnot null VARCHAR
Biographical Directory ID of the member.
term_numbernot null INTEGER
Ordinal of the term (1 for the member's first), counting both chambers.
chambernot null VARCHAR
'house' or 'senate'.
start_datenot null DATE
Date the term began (or the member was sworn in).
end_date DATE
Date the term ended or ends; earlier than scheduled if the member left early.
statenot null VARCHAR
USPS state or territory code, e.g. 'CA', 'PR', 'DC'.
district INTEGER
House district number (an identifier); 0 for at-large seats and delegates, -1 where historic data has no number. NULL for senators.
senate_class INTEGER
Senate election class (1, 2 or 3: which third of the Senate); NULL for House terms.
state_rank VARCHAR
'senior' or 'junior' senator (current senators only).
party VARCHAR
Party at the start of the term, e.g. 'Democrat', 'Republican', 'Whig'.
caucus VARCHAR
Party the member caucuses with, when different from party.
how VARCHAR
'appointment' or 'special-election' when the term did not start at an election.
end_type VARCHAR
'special-election' when an appointed term ended at a special election.
is_current BOOLEAN
True when today falls within the term of a currently serving member.
url VARCHAR
Official website for the term.
office_address VARCHAR
Washington office mailing address.
phone VARCHAR
Washington office phone number.
contact_form VARCHAR
Official web contact form.
ConstraintsPRIMARY KEY (bioguide_id, term_number) · FOREIGN KEY (bioguide_id) REFERENCES members(bioguide_id)
Examples (2)

Senators serving California on January 1, 2000

SELECT bioguide_id, party, start_date, end_date
FROM us_congress.main.member_terms
WHERE chamber = 'senate' AND state = 'CA' AND DATE '2000-01-01' BETWEEN start_date AND end_date
ORDER BY bioguide_id;

Size of each party's House delegation in the 1st Congress

SELECT party, count(DISTINCT bioguide_id) AS members
FROM us_congress.main.member_terms
WHERE chamber = 'house' AND start_date < DATE '1791-03-04' AND end_date > DATE '1789-03-04'
GROUP BY party
ORDER BY members DESC;
Link
members 2 examples31 cols

Every member of Congress since 1789, one row per person, keyed by bioguide_id, with cross-walk IDs.

Columns
bioguide_idnot null VARCHAR
Biographical Directory ID, e.g. 'S000148'; the join key.
full_name VARCHAR
Official full name, or first/middle/last when no official form exists.
first_name VARCHAR
Given name.
middle_name VARCHAR
Middle name or initial.
last_name VARCHAR
Surname.
suffix VARCHAR
Name suffix such as 'Jr.' or 'III'.
nickname VARCHAR
Commonly used nickname.
birthday DATE
Date of birth, when known.
gender VARCHAR
'M' or 'F' as recorded by the dataset.
is_current BOOLEAN
True for members in the legislators-current file (serving now).
first_term_start DATE
Start date of the member's first term.
last_term_end DATE
End date of the member's latest term (a future date for current terms).
term_count INTEGER
Number of terms served (House terms are two years, Senate terms six).
house_terms INTEGER
Number of House terms (including delegate and resident-commissioner terms).
senate_terms INTEGER
Number of Senate terms.
latest_chamber VARCHAR
'house' or 'senate': the chamber of the latest term.
latest_state VARCHAR
USPS state or territory code of the latest term, e.g. 'VT'.
latest_party VARCHAR
Party of the latest term, e.g. 'Democrat', 'Republican', 'Independent'.
thomas_id VARCHAR
THOMAS ID (Library of Congress legacy system), 5 digits.
lis_id VARCHAR
Senate LIS member ID, e.g. 'S313'; used by Senate roll-call XML.
govtrack_id BIGINT
GovTrack.us person ID (an identifier, not a quantity).
icpsr_id BIGINT
ICPSR member ID (an identifier); Voteview's member key.
opensecrets_id VARCHAR
OpenSecrets (CRP) candidate ID, e.g. 'N00000528'.
votesmart_id BIGINT
Vote Smart candidate ID (an identifier).
fec_ids VARCHAR[]
Federal Election Commission candidate IDs (one per office sought).
cspan_id BIGINT
C-SPAN video library person ID (an identifier).
wikipedia VARCHAR
English Wikipedia page title.
wikidata_id VARCHAR
Wikidata entity ID, e.g. 'Q359442'.
ballotpedia VARCHAR
Ballotpedia page title.
house_history_id BIGINT
History, Art & Archives of the House person ID (an identifier).
google_entity_id VARCHAR
Google Knowledge Graph entity ID.
ConstraintsPRIMARY KEY (bioguide_id)
Examples (2)

Current senators by party

SELECT latest_party, count(*) AS senators
FROM us_congress.main.members
WHERE is_current AND latest_chamber = 'senate'
GROUP BY latest_party
ORDER BY senators DESC;

Members with the most terms served

SELECT bioguide_id, full_name, term_count
FROM us_congress.main.members
ORDER BY term_count DESC, bioguide_id
LIMIT 10;
Link
Scalar functions
vote_cast_label (cast_code BIGINT) 3 examples

Decode a Voteview cast code (0-9) into its label: 1 is 'Yea', 6 is 'Nay', 9 is 'Not Voting'

Arguments
cast_code BIGINT
Voteview cast code, 0 to 9; NULL in, NULL out.
ReturnsVARCHAR
Examples (3)

What a paired yea is called

SELECT us_congress.main.vote_cast_label(2) AS label;

List all ten Voteview cast codes

SELECT c AS cast_code, us_congress.main.vote_cast_label(c) AS label
FROM range(10) t(c)
ORDER BY cast_code;
SELECT c, us_congress.main.vote_cast_label(c) AS label
FROM (VALUES (1), (6), (9)) t(c)
ORDER BY c;
Link
Table functions
amendments (amendment_type := VARCHAR, congress := BIGINT) 2 examples

List House and Senate amendments from Congress.gov, with filters pushed into the API

Named arguments
amendment_type := VARCHAR
'hamdt', 'samdt' or 'suamdt' (needs congress). · default null
congress := BIGINT
Only this Congress. · default null
Returns columns
congress INTEGER
Congress number, e.g. 118.
amendment_type VARCHAR
'hamdt' (House), 'samdt' (Senate) or 'suamdt' (Senate unprinted).
amendment_number INTEGER
Amendment number within its type and Congress.
description VARCHAR
Description (House amendments).
purpose VARCHAR
Purpose (Senate amendments), e.g. 'In the nature of a substitute.'.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Latest action text.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the amendment.
Examples (2)

Ten recently updated Senate amendments of the 118th Congress

SELECT amendment_number, purpose, latest_action_text
FROM us_congress.main.amendments(congress := 118, amendment_type := 'samdt')
LIMIT 10;

Amendments of the 119th Congress updated since November 1, 2026

SELECT amendment_type, count(*) AS n
FROM us_congress.main.amendments()
WHERE congress = 119 AND update_date >= TIMESTAMPTZ '2026-11-01 00:00:00+00'
GROUP BY amendment_type;
Link
bill (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

One bill's sponsor, policy area, status and counts from Congress.gov

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
bill_id VARCHAR
Bill ID, e.g. 'hr2882-118'.
title VARCHAR
Bill title.
origin_chamber VARCHAR
'house' or 'senate'.
introduced_date DATE
Date introduced.
policy_area VARCHAR
CRS policy area, e.g. 'Economics and Public Finance'.
sponsor_bioguide_id VARCHAR
Bioguide ID of the (first) sponsor.
sponsor_name VARCHAR
Sponsor display name, e.g. 'Rep. Ciscomani, Juan [R-AZ-6]'.
sponsor_party VARCHAR
Sponsor's party letter.
sponsor_state VARCHAR
Sponsor's state code.
sponsor_district INTEGER
Sponsor's House district (NULL for senators).
cosponsor_count INTEGER
Current cosponsors.
action_count INTEGER
Recorded actions.
amendment_count INTEGER
Amendments offered to the bill.
committee_count INTEGER
Committees the bill was referred to.
summary_count INTEGER
CRS summaries.
text_version_count INTEGER
Published text versions.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Text of the latest action.
became_law BOOLEAN
True when the bill was enacted.
law_numbers VARCHAR[]
Law numbers, e.g. ['118-47'], when enacted.
law_types VARCHAR[]
'Public Law' or 'Private Law' for each law number.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
congress_gov_url VARCHAR
Congress.gov web page of the bill.
api_url VARCHAR
Congress.gov API URL of the bill.
Examples (2)

Who sponsored H.R. 2882 (118th) and whether it became law

SELECT title, sponsor_bioguide_id, policy_area, became_law, law_numbers
FROM us_congress.main.bill(118, 'hr', 2882);

Join a bill's sponsor to the members table

SELECT b.title, m.full_name, m.latest_party
FROM us_congress.main.bill(118, 'hr', 2882) b
JOIN us_congress.main.members m ON m.bioguide_id = b.sponsor_bioguide_id;
Link
bill_actions (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

Every recorded action on one bill, newest first, with links to roll-call votes

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
action_date DATE
Date of the action.
action_time VARCHAR
Time of day of the action (HH:MM:SS), when recorded.
action_text VARCHAR
What happened, e.g. 'Passed/agreed to in House: On passage Passed by the Yeas and Nays: 286 - 134.'.
action_type VARCHAR
Action type, e.g. 'IntroReferral', 'Floor', 'President', 'BecameLaw'.
action_code VARCHAR
Congress.gov action code, e.g. 'H11100', '36000'.
source_system VARCHAR
Who recorded it, e.g. 'House floor actions', 'Library of Congress'.
committee_names VARCHAR[]
Committees involved in the action.
vote_chamber VARCHAR
'house' or 'senate' when the action was a recorded vote.
vote_session INTEGER
Session of the recorded vote.
vote_roll_number INTEGER
Clerk roll-call number of the recorded vote (matches rollcalls.clerk_rollnumber, senate_votes.vote_number and house_votes.roll_call_number).
Examples (2)

The recorded votes on H.R. 2882 (118th)

SELECT action_date, action_type, action_text
FROM us_congress.main.bill_actions(118, 'hr', 2882)
WHERE vote_roll_number IS NOT NULL
ORDER BY action_date;

Count a bill's actions by type

SELECT action_type, count(*) AS actions
FROM us_congress.main.bill_actions(118, 'hr', 2882)
GROUP BY action_type
ORDER BY actions DESC;
Link
bill_cosponsors (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

The cosponsors of one bill with sign-on dates and bioguide IDs

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
bioguide_id VARCHAR
Cosponsor's bioguide ID; join members.
full_name VARCHAR
Display name, e.g. 'Rep. Cole, Tom [R-OK-4]'.
first_name VARCHAR
First name.
last_name VARCHAR
Last name.
party VARCHAR
Party letter.
state VARCHAR
State code.
district INTEGER
House district (NULL for senators).
is_original_cosponsor BOOLEAN
True when the member cosponsored at introduction.
sponsorship_date DATE
Date the member signed on.
sponsorship_withdrawn_date DATE
Date the member withdrew, if they did.
Examples (2)

Cosponsors of H.R. 2882 (118th) by party

SELECT party, count(*) AS cosponsors
FROM us_congress.main.bill_cosponsors(118, 'hr', 2882)
WHERE sponsorship_withdrawn_date IS NULL
GROUP BY party
ORDER BY party;

Members who signed on after introduction

SELECT bioguide_id, full_name, sponsorship_date
FROM us_congress.main.bill_cosponsors(118, 'hr', 2882)
WHERE NOT is_original_cosponsor
ORDER BY sponsorship_date;
Link
bill_subjects (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

The CRS policy area and legislative subject terms of one bill

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
subject VARCHAR
Legislative subject term (or the policy area), e.g. 'Appropriations'.
is_policy_area BOOLEAN
True for the bill's single CRS policy area row.
update_date TIMESTAMP WITH TIME ZONE
When the term was assigned or updated.
Examples (2)

The first 20 subject terms of H.R. 2882 (118th)

SELECT subject
FROM us_congress.main.bill_subjects(118, 'hr', 2882)
WHERE NOT is_policy_area
ORDER BY subject
LIMIT 20;

A bill's policy area

SELECT subject
FROM us_congress.main.bill_subjects(118, 'hr', 2882)
WHERE is_policy_area;
Link
bill_summaries (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

The Congressional Research Service summaries of one bill, one per legislative stage

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
version_code VARCHAR
CRS summary version code, e.g. '00' (as introduced).
action_date DATE
Date of the action the summary describes.
action_desc VARCHAR
Stage summarized, e.g. 'Introduced in House', 'Public Law'.
update_date TIMESTAMP WITH TIME ZONE
When the summary was published or updated.
summary_html VARCHAR
The CRS summary text, as HTML.
Examples (2)

The summary versions of H.R. 2882 (118th)

SELECT action_date, action_desc, length(summary_html) AS chars
FROM us_congress.main.bill_summaries(118, 'hr', 2882)
ORDER BY action_date;

The most recent summary of a bill

SELECT summary_html
FROM us_congress.main.bill_summaries(118, 'hr', 2882)
ORDER BY action_date DESC, version_code DESC
LIMIT 1;
Link
bill_text_versions (congress BIGINT, bill_type VARCHAR, bill_number BIGINT) 2 examples

The published text versions of one bill with links to HTML, PDF and XML

Arguments
congress BIGINT
Congress number, e.g. 118 (2023-2025).
bill_type VARCHAR
Bill type code: 'hr', 's', 'hjres', 'sjres', 'hconres', 'sconres', 'hres', 'sres'.
bill_number BIGINT
Bill number, e.g. 2882 for H.R. 2882.
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
version_type VARCHAR
Text version, e.g. 'Introduced in House', 'Enrolled Bill'.
version_date TIMESTAMP WITH TIME ZONE
Date of the version (NULL for some enrolled bills).
html_url VARCHAR
URL of the formatted text (HTML).
pdf_url VARCHAR
URL of the PDF.
xml_url VARCHAR
URL of the USLM/Bill DTD XML.
Examples (2)

The text versions of H.R. 2882 (118th) in order

SELECT version_type, version_date, pdf_url
FROM us_congress.main.bill_text_versions(118, 'hr', 2882)
ORDER BY version_date NULLS LAST;

The XML of the enrolled (final) text

SELECT xml_url
FROM us_congress.main.bill_text_versions(118, 'hr', 2882)
WHERE version_type = 'Enrolled Bill';
Link
bills (bill_type := VARCHAR, congress := BIGINT) 2 examples

List bills and resolutions from Congress.gov, newest update first, with filters pushed into the API

Named arguments
bill_type := VARCHAR
Only this bill type (needs congress): 'hr', 's', 'hjres', ... · default null
congress := BIGINT
Only this Congress (or filter WHERE congress = N). · default null
Returns columns
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
bill_id VARCHAR
Bill ID as '<type><number>-<congress>', e.g. 'hr2882-118'.
title VARCHAR
Bill title (the latest official or display title).
origin_chamber VARCHAR
'house' or 'senate': where the bill was introduced.
introduced_date DATE
Date introduced.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Text of the latest action, e.g. 'Became Public Law No: 118-47.'.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the bill record.
update_date_including_text TIMESTAMP WITH TIME ZONE
Last update including bill text.
api_url VARCHAR
Congress.gov API URL of the bill detail.
Examples (2)

The ten House joint resolutions of the 118th Congress with the most recent action

SELECT bill_id, title, latest_action_date
FROM us_congress.main.bills(congress := 118, bill_type := 'hjres')
ORDER BY latest_action_date DESC
LIMIT 10;

Bills of the 119th Congress updated since November 1, 2026, by type

SELECT bill_type, count(*) AS bills
FROM us_congress.main.bills()
WHERE congress = 119 AND update_date >= TIMESTAMPTZ '2026-11-01 00:00:00+00'
GROUP BY bill_type
ORDER BY bills DESC;
Link
committees (chamber := VARCHAR, congress := BIGINT) 2 examples

House, Senate and joint committees and subcommittees from Congress.gov

Named arguments
chamber := VARCHAR
'house', 'senate' or 'joint'; NULL for all. · default null
congress := BIGINT
Committees of this Congress. · default null
Returns columns
system_code VARCHAR
Committee system code, e.g. 'hspw00' (subcommittees end in digits).
name VARCHAR
Committee name, e.g. 'Transportation and Infrastructure Committee'.
chamber VARCHAR
'house', 'senate' or 'joint'.
committee_type VARCHAR
'Standing', 'Select', 'Special', 'Joint', 'Subcommittee', ...
parent_system_code VARCHAR
Parent committee's system code, for subcommittees.
parent_name VARCHAR
Parent committee's name, for subcommittees.
subcommittee_count INTEGER
Number of subcommittees.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the committee.
Examples (2)

The Senate's full committees in the 118th Congress

SELECT system_code, name, subcommittee_count
FROM us_congress.main.committees(congress := 118, chamber := 'senate')
WHERE parent_system_code IS NULL
ORDER BY name;

House committees by type

SELECT committee_type, count(*) AS committees
FROM us_congress.main.committees(chamber := 'house')
GROUP BY committee_type
ORDER BY committees DESC;
Link
congress_gov_members (congress := BIGINT, current_only := BOOLEAN, district := BIGINT, state := VARCHAR) 2 examples

Members of Congress as listed by Congress.gov, by Congress, state and district, with portraits

Named arguments
congress := BIGINT
Members who served in this Congress. · default null
current_only := BOOLEAN
Only members serving now. · default false
district := BIGINT
House district (needs state). · default null
state := VARCHAR
Two-letter state code, e.g. 'CA'. · default null
Returns columns
bioguide_id VARCHAR
Bioguide ID; join members and member_terms.
name VARCHAR
Name as 'Last, First', e.g. 'Fong, Vince'.
party_name VARCHAR
Party, e.g. 'Democratic', 'Republican', 'Independent'.
state_name VARCHAR
Full state name, e.g. 'California'.
district INTEGER
House district of the latest term (NULL for senators).
chambers VARCHAR[]
Chambers served in: 'house' and/or 'senate'.
first_year INTEGER
First year of service.
last_year INTEGER
Last year of service (NULL while serving).
image_url VARCHAR
Official portrait URL.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the member.
Examples (2)

California's delegation in the 118th Congress by party

SELECT party_name, count(*) AS members
FROM us_congress.main.congress_gov_members(congress := 118, state := 'CA')
GROUP BY party_name
ORDER BY members DESC;

Vermont's current members with portraits

SELECT bioguide_id, name, image_url
FROM us_congress.main.congress_gov_members(state := 'VT', current_only := true)
ORDER BY name;
Link
cosponsored_legislation (bioguide_id VARCHAR) 2 examples

Every bill, resolution and amendment one member cosponsored, from Congress.gov

Arguments
bioguide_id VARCHAR
Bioguide ID, e.g. 'S000148' (find it in members).
Returns columns
bioguide_id VARCHAR
The member whose legislation this is.
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code (NULL for amendments).
bill_number INTEGER
Bill number (NULL for amendments).
bill_id VARCHAR
Bill ID, e.g. 's4417-117' (NULL for amendments).
amendment_number INTEGER
Amendment number, for sponsored amendments.
title VARCHAR
Bill title.
introduced_date DATE
Date introduced.
policy_area VARCHAR
CRS policy area.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Latest action text.
api_url VARCHAR
Congress.gov API URL of the bill or amendment.
Examples (2)

How many bills Senator Schumer cosponsored in each of the last five Congresses

SELECT congress, count(*) AS bills
FROM us_congress.main.cosponsored_legislation('S000148')
GROUP BY congress
ORDER BY congress DESC
LIMIT 5;

Recent health bills a member cosponsored

SELECT bill_id, title
FROM us_congress.main.cosponsored_legislation('S000148')
WHERE policy_area = 'Health'
ORDER BY introduced_date DESC
LIMIT 10;
Link
house_vote_positions (congress BIGINT, session BIGINT, roll_call_number BIGINT) 2 examples

How each representative voted on one House roll call, from Congress.gov's beta vote API

Arguments
congress BIGINT
Congress number (118 on).
session BIGINT
Session: 1 or 2.
roll_call_number BIGINT
Roll-call number within the session, from house_votes.
Returns columns
congress INTEGER
Congress number.
session INTEGER
Session.
roll_call_number INTEGER
House roll-call number within the session.
vote_question VARCHAR
The question, e.g. 'On Passage'.
result VARCHAR
Outcome of the vote.
bioguide_id VARCHAR
Member's bioguide ID; join members.
first_name VARCHAR
First name.
last_name VARCHAR
Last name.
party VARCHAR
Party letter: 'D', 'R' or 'I'.
state VARCHAR
State code.
vote_cast VARCHAR
'Aye'/'Yea', 'No'/'Nay', 'Present' or 'Not Voting'.
Examples (2)

The party split on House roll call 296 of 2023

SELECT party, vote_cast, count(*) AS members
FROM us_congress.main.house_vote_positions(118, 1, 296)
GROUP BY party, vote_cast
ORDER BY party, vote_cast;

Representatives who did not vote

SELECT bioguide_id, last_name, state
FROM us_congress.main.house_vote_positions(118, 1, 296)
WHERE vote_cast = 'Not Voting'
ORDER BY last_name;
Link
house_votes (congress BIGINT, session := BIGINT) 2 examples

House roll-call votes on legislation from Congress.gov's beta vote API, 118th Congress on

Positional arguments
congress BIGINT
Congress number; the beta endpoint covers the 118th on.
Named arguments
session := BIGINT
1 or 2; NULL for both. · default null
Returns columns
congress INTEGER
Congress number (118 onward).
session INTEGER
Session (1 or 2).
roll_call_number INTEGER
House roll-call number within the session.
identifier BIGINT
Congress.gov vote identifier (congress, session, year, number).
start_time TIMESTAMP WITH TIME ZONE
When the vote opened.
vote_type VARCHAR
'Yea and Nay', 'Recorded Vote', '2/3 Yea-And-Nay', 'Quorum', ...
result VARCHAR
'Passed', 'Failed' or 'Agreed to'.
legislation_type VARCHAR
Measure type: 'hr', 'hres', 'hjres', 'hconres' (NULL for amendments).
legislation_number INTEGER
Measure number.
amendment_type VARCHAR
'hamdt' when the vote was on an amendment.
amendment_number INTEGER
Amendment number.
amendment_author VARCHAR
Amendment author, e.g. 'Davidson of Ohio Amendment No. 51'.
legislation_url VARCHAR
Congress.gov page of the measure.
source_data_url VARCHAR
The Clerk's roll-call XML.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
Examples (2)

Outcomes of House roll calls in 2023

SELECT result, count(*) AS votes
FROM us_congress.main.house_votes(118, session := 1)
GROUP BY result
ORDER BY votes DESC;

The ten most recent House votes of the 119th Congress

SELECT roll_call_number, start_time, legislation_type, legislation_number,
  result
FROM us_congress.main.house_votes(119)
ORDER BY start_time DESC
LIMIT 10;
Link
laws (congress BIGINT, law_type := VARCHAR) 2 examples

The public and private laws enacted by one Congress, with the bill each one came from

Positional arguments
congress BIGINT
Congress number, e.g. 118. Congress.gov has laws from the 93rd on.
Named arguments
law_type := VARCHAR
'public' or 'private'; NULL lists both. · default null
Returns columns
law_number VARCHAR
Law number '<congress>-<n>', e.g. '118-47'.
law_type VARCHAR
'Public Law' or 'Private Law'.
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code: hr, s, hjres, sjres, hconres, sconres, hres, sres.
bill_number INTEGER
Bill number within its type and Congress, e.g. 2882.
bill_id VARCHAR
Bill ID of the enacted bill, e.g. 'hr2882-118'.
title VARCHAR
Title of the enacted bill.
origin_chamber VARCHAR
'house' or 'senate'.
latest_action_date DATE
Date of the latest action (usually the signing).
latest_action_text VARCHAR
Latest action, e.g. 'Became Public Law No: 118-47.'.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the bill.
Examples (2)

How many public and private laws the 118th Congress enacted

SELECT law_type, count(*) AS laws
FROM us_congress.main.laws(118)
GROUP BY law_type
ORDER BY law_type;

The ten most recently signed public laws of the 118th Congress

SELECT law_number, title
FROM us_congress.main.laws(118, law_type := 'public')
ORDER BY latest_action_date DESC
LIMIT 10;
Link
member_ideology (congress BIGINT, chamber := VARCHAR) +1 overload 2 examples
Positional arguments
congress BIGINT
Congress number, 1 (1789-1791) to the current one; e.g. 118 for 2023-2025.
Named arguments
chamber := VARCHAR
Limit to one chamber: 'house' or 'senate'. NULL (the default) reads both. · default null
Overloads
member_ideology(congress BIGINT, chamber VARCHAR)member_ideology(chamber VARCHAR)
Returns columns
congress INTEGER
Congress number.
chamber VARCHAR
'house', 'senate' or 'president'.
icpsr BIGINT
ICPSR member ID.
bioguide_id VARCHAR
Bioguide ID (NULL for presidents who never served in Congress).
bioname VARCHAR
Name as 'LAST, First Middle', e.g. 'SANDERS, Bernard'.
state_abbrev VARCHAR
USPS state code ('USA' for presidents).
district_code INTEGER
House district (0 at-large; 0 for senators).
party_code INTEGER
Voteview party code, e.g. 100 Democrat, 200 Republican, 328 Independent.
party_name VARCHAR
Party name for party_code, from Voteview's parties file.
born INTEGER
Year of birth.
died INTEGER
Year of death.
nominate_dim1 DOUBLE
DW-NOMINATE dimension 1 (economic liberal -1 to conservative +1).
nominate_dim2 DOUBLE
DW-NOMINATE dimension 2 (cross-cutting issues of the era).
nominate_log_likelihood DOUBLE
Log-likelihood of the member's votes.
nominate_geo_mean_probability DOUBLE
Geometric mean probability of the member's votes.
nominate_number_of_votes INTEGER
Votes used to estimate the scores.
nominate_number_of_errors INTEGER
Votes the model predicts wrongly.
nokken_poole_dim1 DOUBLE
Nokken-Poole (single-Congress) score, dimension 1.
nokken_poole_dim2 DOUBLE
Nokken-Poole (single-Congress) score, dimension 2.
state_icpsr INTEGER
ICPSR state code.
occupancy INTEGER
ICPSR occupancy code for the seat (order of occupants).
last_means INTEGER
ICPSR code for how the member last attained the seat.
Examples (2)

Party medians on the first DW-NOMINATE dimension in the 118th House

SELECT party_name, round(median(nominate_dim1), 3) AS median_dim1
FROM us_congress.main.member_ideology(118, chamber := 'house')
GROUP BY party_name
ORDER BY median_dim1;

The gap between Senate Republican and Democratic medians since the 100th Congress

SELECT congress,
  round(median(nominate_dim1) FILTER (WHERE party_code = 200) - median(nominate_dim1) FILTER (WHERE party_code = 100), 3) AS gap
FROM us_congress.main.member_ideology(chamber := 'senate')
WHERE congress >= 100
GROUP BY congress
ORDER BY congress;
Link
member_votes (congress BIGINT, chamber := VARCHAR) 2 examples

How every member voted on every roll call of one Congress, from Voteview, with bioguide IDs

Positional arguments
congress BIGINT
Congress number, 1 (1789-1791) to the current one; e.g. 118 for 2023-2025.
Named arguments
chamber := VARCHAR
Limit to one chamber: 'house' or 'senate'. NULL (the default) reads both. · default null
Returns columns
congress INTEGER
Congress number.
chamber VARCHAR
'house' or 'senate'.
rollnumber INTEGER
Voteview roll-call number; joins to rollcalls.
icpsr BIGINT
Member's ICPSR ID (Voteview's member key).
bioguide_id VARCHAR
Member's bioguide ID, from Voteview's member file for that Congress.
cast_code INTEGER
Voteview cast code 0-9; see vote_cast_label().
vote VARCHAR
Simplified position: 'Yea', 'Nay', 'Present', 'Not Voting' or 'Not a member'.
vote_detail VARCHAR
Detailed position, e.g. 'Paired Yea', 'Announced Nay'.
prob DOUBLE
Probability (0-100) DW-NOMINATE assigns to the vote cast.
Examples (2)

Senators who missed the most roll calls in the 118th Congress

SELECT bioguide_id, count(*) FILTER (WHERE vote = 'Not Voting') AS missed,
  count(*) AS votes
FROM us_congress.main.member_votes(118, chamber := 'senate')
GROUP BY bioguide_id
ORDER BY missed DESC
LIMIT 5;

How the Senate split on the first roll call of the 119th Congress

SELECT v.vote, count(*) AS members
FROM us_congress.main.member_votes(119, chamber := 'senate') v
WHERE v.rollnumber = 1
GROUP BY v.vote
ORDER BY members DESC;
Link
nominations (congress := BIGINT) 2 examples

Presidential nominations sent to the Senate, with their latest action, from Congress.gov

Named arguments
congress := BIGINT
Only this Congress. · default null
Returns columns
congress INTEGER
Congress number, e.g. 118.
number INTEGER
Nomination number, e.g. 1064 for PN1064.
part_number VARCHAR
Part number when a nomination is split, e.g. '00'.
citation VARCHAR
Citation, e.g. 'PN1064' or 'PN12-1' (matches senate_votes.issue).
description VARCHAR
Nominee and position, e.g. 'Lisette Nieves, of New York, to be ...'.
organization VARCHAR
Agency or organization of the position.
received_date DATE
Date the Senate received the nomination.
is_civilian BOOLEAN
True for civilian nominations.
is_military BOOLEAN
True for military promotions lists.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Latest action, e.g. 'Confirmed by the Senate by Voice Vote.'.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the nomination.
Examples (2)

Organizations with the most civilian nominations in the 118th Congress

SELECT organization, count(*) AS nominations
FROM us_congress.main.nominations(congress := 118)
WHERE is_civilian
GROUP BY organization
ORDER BY nominations DESC
LIMIT 10;

The ten most recent confirmations in the 119th Congress

SELECT citation, description
FROM us_congress.main.nominations(congress := 119)
WHERE latest_action_text ILIKE '%confirmed%'
ORDER BY latest_action_date DESC
LIMIT 10;
Link
rollcalls (congress BIGINT, chamber := VARCHAR) +1 overload 2 examples
Positional arguments
congress BIGINT
Congress number, 1 (1789-1791) to the current one; e.g. 118 for 2023-2025.
Named arguments
chamber := VARCHAR
Limit to one chamber: 'house' or 'senate'. NULL (the default) reads both. · default null
Overloads
rollcalls(congress BIGINT, chamber VARCHAR)rollcalls(chamber VARCHAR)
Returns columns
congress INTEGER
Congress number, e.g. 118 for 2023-2025.
chamber VARCHAR
'house' or 'senate'.
rollnumber INTEGER
Voteview roll-call number, sequential within the Congress.
date DATE
Date of the vote.
session INTEGER
Session of the Congress (1 or 2; occasionally 3).
clerk_rollnumber INTEGER
The chamber clerk's roll-call number, which restarts each session; matches senate_votes.vote_number and house_votes.roll_call_number.
majority_requirement VARCHAR
Fraction needed to pass, e.g. '1/2', '3/5', '2/3'.
yea_count INTEGER
Members voting yea.
nay_count INTEGER
Members voting nay.
bill_number VARCHAR
Measure voted on, e.g. 'HR2882', 'S5' or a nomination 'PN11817'.
vote_result VARCHAR
Outcome as recorded, e.g. 'Passed', 'Cloture Motion Agreed to'.
vote_desc VARCHAR
Description of the measure or question.
vote_question VARCHAR
The question put, e.g. 'On Passage', 'On the Cloture Motion'.
dtl_desc VARCHAR
Detailed description, for historical votes.
nominate_mid_1 DOUBLE
DW-NOMINATE cutting-line midpoint, dimension 1.
nominate_mid_2 DOUBLE
DW-NOMINATE cutting-line midpoint, dimension 2.
nominate_spread_1 DOUBLE
DW-NOMINATE spread, dimension 1.
nominate_spread_2 DOUBLE
DW-NOMINATE spread, dimension 2.
nominate_log_likelihood DOUBLE
Log-likelihood of the vote under the DW-NOMINATE model.
Examples (2)

The most common outcomes of Senate roll calls in the 118th Congress

SELECT vote_result, count(*) AS votes
FROM us_congress.main.rollcalls(118, chamber := 'senate')
GROUP BY vote_result
ORDER BY votes DESC
LIMIT 5;

House roll calls per Congress since the 110th

SELECT congress, count(*) AS roll_calls
FROM us_congress.main.rollcalls(chamber := 'house')
WHERE congress >= 110
GROUP BY congress
ORDER BY congress;
Link
senate_vote_positions (congress BIGINT, session BIGINT, vote_number BIGINT) 2 examples

How each senator voted on one Senate roll call, from senate.gov, with bioguide IDs

Arguments
congress BIGINT
Congress number; senate.gov XML covers the 101st (1989) onward.
session BIGINT
Session of the Congress: 1 or 2.
vote_number BIGINT
Senate roll-call number within the session, from senate_votes.
Returns columns
congress INTEGER
Congress number.
session INTEGER
Session of the Congress.
vote_number INTEGER
Senate roll-call number within the session.
vote_timestamp TIMESTAMP WITH TIME ZONE
When the vote was taken.
question VARCHAR
Full question text, e.g. 'On Cloture on the Motion to Proceed S. 5'.
vote_title VARCHAR
Title of the vote.
vote_result VARCHAR
Outcome of the vote.
majority_requirement VARCHAR
Fraction needed, e.g. '1/2' or '3/5'.
document_name VARCHAR
Measure voted on, e.g. 'S. 5' or 'PN373'.
lis_member_id VARCHAR
Senate LIS member ID, e.g. 'S428'.
bioguide_id VARCHAR
Bioguide ID of the senator, via congress-legislators.
first_name VARCHAR
Senator's first name.
last_name VARCHAR
Senator's last name.
party VARCHAR
Party letter: 'D', 'R' or 'I'.
state VARCHAR
USPS state code.
vote_cast VARCHAR
'Yea', 'Nay', 'Present', 'Not Voting' or 'Guilty'/'Not Guilty' at trials.
Examples (2)

The party breakdown of the first Senate vote of 2025

SELECT party, vote_cast, count(*) AS senators
FROM us_congress.main.senate_vote_positions(119, 1, 1)
GROUP BY party, vote_cast
ORDER BY party, vote_cast;

Senators who voted nay on that vote, with their full names

SELECT p.bioguide_id, m.full_name
FROM us_congress.main.senate_vote_positions(119, 1, 1) p
JOIN us_congress.main.members m USING (bioguide_id)
WHERE p.vote_cast = 'Nay'
ORDER BY m.full_name;
Link
senate_votes (congress BIGINT, session BIGINT) 2 examples

Every Senate roll-call vote of one session, straight from senate.gov, including today's votes

Arguments
congress BIGINT
Congress number; senate.gov XML covers the 101st (1989) onward.
session BIGINT
Session of the Congress: 1 (odd year) or 2 (even year).
Returns columns
congress INTEGER
Congress number.
session INTEGER
Session of the Congress (1 or 2).
vote_number INTEGER
Senate roll-call number within the session.
vote_date DATE
Date of the vote.
issue VARCHAR
Measure or nomination voted on, e.g. 'S. 5', 'PN373'.
question VARCHAR
The question, e.g. 'On the Cloture Motion', 'On Passage of the Bill'.
result VARCHAR
Outcome, e.g. 'Agreed to', 'Rejected', 'Confirmed', 'Passed'.
yeas INTEGER
Yea votes.
nays INTEGER
Nay votes.
title VARCHAR
Title of the vote, e.g. 'Motion to Invoke Cloture: ...'.
Examples (2)

The last ten Senate votes of 2025

SELECT vote_number, vote_date, question, result, yeas, nays
FROM us_congress.main.senate_votes(119, 1)
ORDER BY vote_number DESC
LIMIT 10;

How cloture votes turned out in 2025

SELECT result, count(*) AS votes
FROM us_congress.main.senate_votes(119, 1)
WHERE question ILIKE '%cloture%'
GROUP BY result
ORDER BY votes DESC;
Link
sponsored_legislation (bioguide_id VARCHAR) 2 examples

Every bill, resolution and amendment one member sponsored, from Congress.gov

Arguments
bioguide_id VARCHAR
Bioguide ID, e.g. 'S000148' (find it in members).
Returns columns
bioguide_id VARCHAR
The member whose legislation this is.
congress INTEGER
Congress number, e.g. 118.
bill_type VARCHAR
Bill type code (NULL for amendments).
bill_number INTEGER
Bill number (NULL for amendments).
bill_id VARCHAR
Bill ID, e.g. 's4417-117' (NULL for amendments).
amendment_number INTEGER
Amendment number, for sponsored amendments.
title VARCHAR
Bill title.
introduced_date DATE
Date introduced.
policy_area VARCHAR
CRS policy area.
latest_action_date DATE
Date of the latest action.
latest_action_text VARCHAR
Latest action text.
api_url VARCHAR
Congress.gov API URL of the bill or amendment.
Examples (2)

The five policy areas Senator Schumer has sponsored the most bills in

SELECT policy_area, count(*) AS bills
FROM us_congress.main.sponsored_legislation('S000148')
WHERE bill_id IS NOT NULL
GROUP BY policy_area
ORDER BY bills DESC
LIMIT 5;

Sponsored legislation per Congress

SELECT congress, count(*) AS bills
FROM us_congress.main.sponsored_legislation('S000148')
GROUP BY congress
ORDER BY congress;
Link
treaties (congress := BIGINT) 2 examples

Treaties transmitted to the Senate for advice and consent, from Congress.gov

Named arguments
congress := BIGINT
Only this Congress. · default null
Returns columns
congress_received INTEGER
Congress in which the treaty was received.
congress_considered INTEGER
Congress in which the Senate considered it.
number INTEGER
Treaty document number within the Congress received.
suffix VARCHAR
Part suffix, e.g. 'A', for treaties split into parts.
topic VARCHAR
Topic, e.g. 'International Law and Organization'.
transmitted_date TIMESTAMP WITH TIME ZONE
Date transmitted to the Senate.
parts_count INTEGER
Number of parts.
update_date TIMESTAMP WITH TIME ZONE
When Congress.gov last updated the record.
api_url VARCHAR
Congress.gov API URL of the treaty.
Examples (2)

Treaties received in the 117th Congress

SELECT number, topic, transmitted_date
FROM us_congress.main.treaties(congress := 117)
ORDER BY transmitted_date;

The most common treaty topics

SELECT topic, count(*) AS treaties
FROM us_congress.main.treaties()
GROUP BY topic
ORDER BY treaties DESC
LIMIT 5;
Link

Credentials

The secret type us_congress declares, as reported by the worker itself.

us_congress

How to get these credentials

Congress.gov API key (a free api.data.gov key) for the bill, law, committee and House vote functions.

secret.sql
CREATE SECRET us_congress (
    TYPE us_congress,
    api_key '<US_CONGRESS_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — api.data.gov key for the Congress.gov API v3; sign up free at https://api.congress.gov/sign-up/

The worker doesn't mark which keys are required.

Needed by billsbillbill_actionsbill_cosponsorsbill_subjectsbill_summariesbill_text_versionslawsamendmentscongress_gov_memberssponsored_legislationcosponsored_legislation and 5 more functions

Create the secret in the same session, after attaching us_congress — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

Senators who missed the most roll calls in the 118th Congress

SELECT bioguide_id, count(*) FILTER (WHERE vote = 'Not Voting') AS missed,
  count(*) AS votes
FROM us_congress.main.member_votes(118, chamber := 'senate')
GROUP BY bioguide_id
ORDER BY missed DESC
LIMIT 5

Uses member_votes

Party medians on the first DW-NOMINATE dimension in the 118th House

SELECT party_name, round(median(nominate_dim1), 3) AS median_dim1
FROM us_congress.main.member_ideology(118, chamber := 'house')
GROUP BY party_name
ORDER BY median_dim1

Uses member_ideology

The last ten Senate votes of 2025

SELECT vote_number, vote_date, question, result, yeas, nays
FROM us_congress.main.senate_votes(119, 1)
ORDER BY vote_number DESC
LIMIT 10

Uses senate_votes

The party breakdown of the first Senate vote of 2025

SELECT party, vote_cast, count(*) AS senators
FROM us_congress.main.senate_vote_positions(119, 1, 1)
GROUP BY party, vote_cast
ORDER BY party, vote_cast

Uses senate_vote_positions

What a paired yea is called

SELECT us_congress.main.vote_cast_label(2) AS label

Uses vote_cast_label

The ten House joint resolutions of the 118th Congress with the most recent action

SELECT bill_id, title, latest_action_date
FROM us_congress.main.bills(congress := 118, bill_type := 'hjres')
ORDER BY latest_action_date DESC
LIMIT 10

Uses bills

46 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the us_congress worker, how many Senate roll-call votes were taken in the 118th Congress?
  • Using the us_congress worker, on how many Senate roll calls of the 118th Congress was Bernie Sanders (bioguide S000033) recorded as not voting?
  • Using the us_congress worker, how many roll-call votes did the Senate hold in 2025 (119th Congress, session 1)?
  • Using the us_congress worker, how many senators voted Nay on the Senate's first roll-call vote of the 119th Congress (session 1, vote 1)?
  • Using the us_congress worker, how many terms did James Madison serve in the House, and which Virginia districts did he represent?
  • Using the us_congress worker, how many files has it downloaded into its cache, and how many bytes?

US Congress is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.