Regulations.gov API Python Client
raw JSON → N/A verified Tue May 12 auth: no python install: stale quickstart: verified
Python client library for the Regulations.gov API v4, providing access to federal regulatory documents, comments, and dockets from the U.S. government's public rulemaking portal. Wraps the REST API with typed Python methods for searching and retrieving regulatory data.
pip install requests Common errors
error ModuleNotFoundError: No module named 'regulations_api_client' ↓
cause The 'regulations-gov-api' library is not installed in your Python environment or the import statement uses an incorrect module name.
fix
pip install regulations-gov-api
error httpx.HTTPStatusError: Client error '401 Unauthorized' for url ↓
cause The API key provided to the RegulationsGovClient is missing, invalid, or expired, preventing access to the Regulations.gov API.
fix
client = RegulationsGovClient(api_key="YOUR_VALID_API_KEY")
error pydantic.ValidationError: 1 validation error for GetDocumentsParameters ↓
cause A required parameter for an API call (e.g., 'docketId' for get_documents) is missing, or a provided parameter has an incorrect type or format.
fix
documents = client.get_documents(docketId="VALID_DOCKET_ID", rpp=10)
error httpx.HTTPStatusError: Client error '429 Too Many Requests' for url ↓
cause The number of API requests from your application has exceeded the Regulations.gov API's rate limits.
fix
Implement a delay (e.g., time.sleep()) or an exponential backoff strategy between consecutive API calls.
error AttributeError: 'RegulationsGovClient' object has no attribute 'search' ↓
cause The method or attribute being called (e.g., 'search') does not exist on the RegulationsGovClient object; the library uses specific method names for different resource types.
fix
documents = client.get_documents(...)
Warnings
breaking An API key from api.data.gov is required for all requests. Without it, every call returns a 403 error. ↓
fix Sign up at https://api.data.gov/signup/ and set the REGULATIONS_GOV_API_KEY environment variable.
gotcha The Regulations.gov API enforces strict rate limits (typically 1,000 requests per hour). Exceeding the limit returns HTTP 429 with no built-in retry in the client. ↓
fix Implement your own rate limiting or exponential backoff when making bulk requests.
gotcha The package name uses hyphens (regulations-gov-api) but the import uses underscores (regulations_gov_api). Mixing them up causes ImportError. ↓
fix Use 'from regulations_gov_api import RegulationsAPI' after installing 'pip install regulations-gov-api'.
gotcha API responses return nested JSON structures following the JSON:API specification. Document fields are under data[].attributes, not at the top level. ↓
fix Access fields via result['data'][i]['attributes']['title'], not result['data'][i]['title'].
gotcha The page_size parameter has a maximum of 250. Requesting more silently caps at 250 or returns an error depending on the endpoint. ↓
fix Use pagination with page_number and page_size <= 250 to retrieve large result sets.
gotcha The pip installer reported warnings regarding running as the 'root' user and available updates. This can lead to permission issues or outdated tooling. ↓
fix It is recommended to use a virtual environment or run pip as a non-root user. Additionally, ensure pip is updated to its latest version by running 'pip install --upgrade pip'.
Install compatibility stale last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) - - - -
3.10 slim (glibc) - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) - - - -
3.12 alpine (musl) - - - -
3.12 slim (glibc) - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -
Imports
- RegulationsAPI wrong
from regulations_gov_api import Clientcorrectfrom regulations_gov_api import RegulationsAPI
Quickstart verified last tested: 2026-05-12
import os
import requests
api_key = os.environ.get("REGULATIONS_GOV_API_KEY", "DEMO_KEY")
resp = requests.get(
"https://api.regulations.gov/v4/documents",
params={"api_key": api_key, "filter[searchTerm]": "climate", "page[size]": 5},
headers={"Accept": "application/json"}
)
resp.raise_for_status()
data = resp.json()
for doc in data.get("data", []):
print(doc["attributes"]["title"])