{"id":112,"library":"regulations-gov-api","title":"Regulations.gov API Python Client","description":"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.","status":"active","version":"N/A","language":"python","source_language":"en","source_url":"https://github.com/jbencina/regulations-gov-api","tags":["regulations","government","api-client","federal","rulemaking","python","regulations-gov"],"install":[{"cmd":"pip install requests","lang":"bash","label":"HTTP client (no official PyPI package)"}],"dependencies":[{"reason":"HTTP client used for all API calls.","package":"requests","optional":false}],"imports":[{"note":"The main client class is RegulationsAPI, not Client.","wrong":"from regulations_gov_api import Client","symbol":"RegulationsAPI","correct":"from regulations_gov_api import RegulationsAPI"}],"quickstart":{"code":"import os\nimport requests\n\napi_key = os.environ.get(\"REGULATIONS_GOV_API_KEY\", \"DEMO_KEY\")\nresp = requests.get(\n    \"https://api.regulations.gov/v4/documents\",\n    params={\"api_key\": api_key, \"filter[searchTerm]\": \"climate\", \"page[size]\": 5},\n    headers={\"Accept\": \"application/json\"}\n)\nresp.raise_for_status()\ndata = resp.json()\nfor doc in data.get(\"data\", []):\n    print(doc[\"attributes\"][\"title\"])","lang":"python","description":"Search for federal regulatory documents using the Regulations.gov API."},"warnings":[{"fix":"Sign up at https://api.data.gov/signup/ and set the REGULATIONS_GOV_API_KEY environment variable.","message":"An API key from api.data.gov is required for all requests. Without it, every call returns a 403 error.","severity":"breaking","affected_versions":"all"},{"fix":"Implement your own rate limiting or exponential backoff when making bulk requests.","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from regulations_gov_api import RegulationsAPI' after installing 'pip install regulations-gov-api'.","message":"The package name uses hyphens (regulations-gov-api) but the import uses underscores (regulations_gov_api). Mixing them up causes ImportError.","severity":"gotcha","affected_versions":"all"},{"fix":"Access fields via result['data'][i]['attributes']['title'], not result['data'][i]['title'].","message":"API responses return nested JSON structures following the JSON:API specification. Document fields are under data[].attributes, not at the top level.","severity":"gotcha","affected_versions":"all"},{"fix":"Use pagination with page_number and page_size <= 250 to retrieve large result sets.","message":"The page_size parameter has a maximum of 250. Requesting more silently caps at 250 or returns an error depending on the endpoint.","severity":"gotcha","affected_versions":"all"},{"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'.","message":"The pip installer reported warnings regarding running as the 'root' user and available updates. This can lead to permission issues or outdated tooling.","severity":"gotcha","affected_versions":"all"}],"env_vars":[{"name":"REGULATIONS_GOV_API_KEY","required":true,"description":"API key obtained from https://api.data.gov/signup/. Required for all requests."}],"last_verified":"2026-05-12T08:10:52.902Z","next_check":"2026-06-17T00:00:00.000Z","problems":[{"fix":"pip install regulations-gov-api","cause":"The 'regulations-gov-api' library is not installed in your Python environment or the import statement uses an incorrect module name.","error":"ModuleNotFoundError: No module named 'regulations_api_client'"},{"fix":"client = RegulationsGovClient(api_key=\"YOUR_VALID_API_KEY\")","cause":"The API key provided to the RegulationsGovClient is missing, invalid, or expired, preventing access to the Regulations.gov API.","error":"httpx.HTTPStatusError: Client error '401 Unauthorized' for url"},{"fix":"documents = client.get_documents(docketId=\"VALID_DOCKET_ID\", rpp=10)","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.","error":"pydantic.ValidationError: 1 validation error for GetDocumentsParameters"},{"fix":"Implement a delay (e.g., time.sleep()) or an exponential backoff strategy between consecutive API calls.","cause":"The number of API requests from your application has exceeded the Regulations.gov API's rate limits.","error":"httpx.HTTPStatusError: Client error '429 Too Many Requests' for url"},{"fix":"documents = client.get_documents(...)","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.","error":"AttributeError: 'RegulationsGovClient' object has no attribute 'search'"}],"ecosystem":"rest","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}