---
name: congress-gov-api-ingestion
description: "How to get Library of Congress Congress.gov API data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load recent Congress.gov bills into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/congress-gov-api
Provider: https://api.congress.gov/
Checked against the provider's documentation: 2026-11-02

## Access
- Sign up for a free api.data.gov key through the Congress.gov API page.
- Set the key in CONGRESS_API_KEY; the API supports JSON and XML responses.

## Request
```bash
curl -H "X-Api-Key: $CONGRESS_API_KEY" 'https://api.congress.gov/v3/bill?format=json&limit=250'
```

## Format
JSON with a bills array containing Congress and bill numbers, type, title, origin chamber, update date and detail URL, plus request and pagination objects.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Recent Congress.gov bills -> pandas -> Parquet. Free API key required."""
import os
import requests
import pandas as pd

URL = "https://api.congress.gov/v3/bill"
headers = {"X-Api-Key": os.environ["CONGRESS_API_KEY"]}
params = {"format": "json", "limit": 250}
r = requests.get(URL, headers=headers, params=params, timeout=60)
r.raise_for_status()
df = pd.json_normalize(r.json()["bills"], sep="_")
df["updateDate"] = pd.to_datetime(df["updateDate"], utc=True)
df.to_parquet("congress_gov_recent_bills.parquet", index=False)
print(len(df), "bills", df["updateDate"].min().isoformat(), "to",
      df["updateDate"].max().isoformat())
```
Not run: it needs a free API key.

## Limits
- Rate limit: 5,000 requests per hour.
- List endpoints return 20 records by default and at most 250 records per request.
- Use the pagination next URL or offset parameter to retrieve additional records.

## Quirks
- Coverage and update timing differ across collections; consult the Congress.gov coverage-dates page for the collection being ingested.
- The updateDate field records a Congress.gov record update, not necessarily the date of the legislative action.
- The provider says its data is what the House and Senate delivered, so late or incomplete chamber data can propagate into the API.

## Terms and attribution
- The provider describes the API as a way for the public to view, retrieve and re-use machine-readable Congress.gov data.
- No single named data licence is stated for every underlying collection; check collection-level rights when redistributing content.
- Terms page: https://github.com/LibraryOfCongress/api.congress.gov/

## Sources
- https://github.com/LibraryOfCongress/api.congress.gov/: "An API key is required for access."
- https://github.com/LibraryOfCongress/api.congress.gov/: "The rate limit is set to 5,000 requests per hour."
- https://github.com/LibraryOfCongress/api.congress.gov/: "The 20 results limit can be adjusted up to 250 results."
- https://github.com/LibraryOfCongress/api.congress.gov/: "While not required, the following citation may be used for attribution:"

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
