Registry / http-networking / regulations-gov-api

regulations-gov-api

JSON →
libraryN/Apyrest✓ verified 28d ago

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
INSTALL
IMPORT
SIG · REGULATIONS-GOV-AP
R
regulations-gov-api
http-networkingpythonvN/A
Install
2.4s avg
Import
345ms
Disk
105MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.356s · 70MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.334s · 141MB
105MB installed
● package 105MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RegulationsAPI
from requests import api
from requests import RegulationsAPI

Search for federal regulatory documents using the Regulations.gov API.

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"])
Debug
Known issues
breakingAn 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.
affects: all
gotchaThe 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.
affects: all
gotchaThe 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'.
affects: all
gotchaAPI 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'].
affects: all
gotchaThe 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.
affects: all
gotchaThe 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'.
affects: all
Upgrade
Version history
N/Alatest on PyPI
Audit
Dependencies
requestsrequiredHTTP client used for all API calls.
Agent activity
21 hits · last 30 days
node
20
Resources

No resource links recorded.

regulations-gov-api — pip install regulations-gov-api · libregistry