TypeScript client for the Congress.gov API
Bills, members, votes, committees, nominations — typed and simple.
Status: Coming Soon — Star this repo to get notified when the first release ships.
The Congress.gov API is powerful but raw — no official SDK, inconsistent response shapes, pagination quirks, and rate limiting that'll bite you. This client handles all of that so you can focus on building.
import { Congress } from '@capitoltrace/congress-api';
const congress = new Congress({ apiKey: 'your-key' });
// Get a bill
const bill = await congress.bill('118', 'hr', '1');
// Search members
const members = await congress.members({ chamber: 'senate', state: 'CA' });
// Get vote details
const vote = await congress.vote('118', 'senate', '1');
// List committees
const committees = await congress.committees({ chamber: 'house' });
// Auto-paginate
for await (const bill of congress.bills.list({ congress: 118 })) {
console.log(bill.title);
}- Full type safety — Every endpoint returns typed responses, no
any - Auto-pagination — Async iterators for list endpoints, no manual
offsetmanagement - Rate limit handling — Built-in retry with backoff for 429 responses
- Zero dependencies — Uses native
fetch()(Node 18+, Deno, Bun, browsers) - Tree-shakeable — Import only what you need
| Resource | Methods |
|---|---|
| 📜 Bills | list, get, actions, cosponsors, subjects, text |
| 👥 Members | list, get, sponsoredLegislation, cosponsoredLegislation |
| 🗳️ Votes | list, get (House + Senate roll calls) |
| 🏛️ Committees | list, get, bills, reports, nominations |
| 📋 Nominations | list, get, actions, hearings |
| 🤝 Treaties | list, get, actions |
| ✏️ Amendments | list, get, actions, cosponsors |
| 📰 Congressional Record | list daily issues |
| 📅 Congress | list, get session info |
# npm
npm install @capitoltrace/congress-api
# yarn
yarn add @capitoltrace/congress-api
# pnpm
pnpm add @capitoltrace/congress-apiCongress.gov API keys are free — sign up here (takes 30 seconds).
This is an open-source project by Capitol Trace. PRs welcome — especially for:
- Additional endpoint coverage
- Better TypeScript types from real API responses
- Deno / Bun compatibility testing
- Documentation improvements
MIT
Part of the Capitol Trace ecosystem.
Built with data from api.congress.gov