{"id":110,"library":"irs-api","title":"IRS API Python Client","description":"Unofficial Python wrapper for accessing IRS (Internal Revenue Service) public data and tax-related information programmatically. Provides convenience methods for retrieving tax forms, instructions, and other IRS public resources.","status":"maintenance","version":"N/A","language":"python","source_language":"en","source_url":"https://pypi.org/project/irs-api/","tags":["irs","tax","government","api","python","forms"],"install":[{"cmd":"pip install requests","lang":"bash","label":"HTTP client (no official PyPI package)"}],"dependencies":[{"reason":"Used for making HTTP requests to IRS endpoints.","package":"requests","optional":false}],"imports":[{"note":"The package name on PyPI is irs-api but the Python module is irs_api (with underscore).","wrong":"from irs import IRS","symbol":"IRS","correct":"from irs_api import IRS"}],"quickstart":{"code":"import requests\n\n# IRS provides several public REST APIs (no key required for most)\n# Forms and publications search\nresp = requests.get(\n    \"https://www.irs.gov/api/forms-pubs/1040\",\n    headers={\"Accept\": \"application/json\"}\n)\n# IRS APIs may return HTML on error — check content-type before parsing\nif resp.ok and \"application/json\" in resp.headers.get(\"Content-Type\", \"\"):\n    print(resp.json())\nelse:\n    print(f\"Status: {resp.status_code}\")","lang":"python","description":"IRS public APIs are REST-only (no PyPI package). Endpoints vary by service. Always check Content-Type before calling .json() — some endpoints return HTML error pages on failure."},"warnings":[{"fix":"from irs_api import IRS","message":"The pip package name is irs-api but the import module uses an underscore: irs_api. Using 'import irs_api' not 'import irs-api'.","severity":"gotcha","affected_versions":"all"},{"fix":"Implement retry logic and fallback handling in case upstream IRS data sources change.","message":"This is an unofficial wrapper around publicly available IRS data. It is not endorsed or maintained by the IRS. Endpoints may break if the IRS changes their public website structure.","severity":"gotcha","affected_versions":"all"},{"fix":"Check the GitHub repository for any open issues or forks with more recent updates before relying on this in production.","message":"The package has not been updated frequently. The last PyPI release is 0.0.3. API surface may be limited or stale.","severity":"deprecated","affected_versions":"all"},{"fix":"Add delays between requests using time.sleep() and cache results locally to minimize repeated calls.","message":"Rate limiting or IP blocking may occur if too many requests are made to IRS endpoints in a short period.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T08:10:17.422Z","next_check":"2026-06-17T00:00:00.000Z","problems":[{"fix":"Ensure the library is installed using pip: `pip install irs-api` or `pip install irs-api --upgrade` if it's already installed and you suspect a version issue.","cause":"The `irs-api` library or its dependencies are not installed in the Python environment you are currently using, or the package name is misspelled.","error":"ModuleNotFoundError: No module named 'irs_api'"},{"fix":"Check your internet connection, verify the URL or endpoint being accessed by the library, and ensure no firewalls or proxies are blocking the request. The IRS server might also be temporarily down.","cause":"The program failed to establish a connection with the IRS data source, often due to network issues, an incorrect URL, or the remote server being unavailable or refusing the connection.","error":"requests.exceptions.ConnectionError: Max retries exceeded with url"},{"fix":"Inspect the actual JSON or dictionary response from the API to confirm the available keys. Update your code to use the correct key names or implement error handling for missing keys (e.g., using `.get('key', default_value)`).","cause":"The program attempted to access a key (data field) in a dictionary-like API response that does not exist or has a different name than expected. This often happens if the IRS API's response structure has changed or the requested data is not available.","error":"KeyError: 'some_data_field'"}],"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}]}}