Registry / http-networking / irs-api

irs-api

JSON →
libraryN/Apyrest✓ verified 47d ago

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.

http-networking
pip install requests
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
glibc
py 3.10
3/5 runs
3/5 runs
py 3.11
3/5 runs
3/5 runs
py 3.12
3/5 runs
3/5 runs
py 3.13
3/5 runs
3/5 runs
py 3.9
3/5 runs
3/5 runs
Code
Verified usage

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

Session
from requests import Session
from requests import IRS
Request
from requests import Request
Response
from requests import Response

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.

import requests # IRS provides several public REST APIs (no key required for most) # Forms and publications search resp = requests.get( "https://www.irs.gov/api/forms-pubs/1040", headers={"Accept": "application/json"} ) # IRS APIs may return HTML on error — check content-type before parsing if resp.ok and "application/json" in resp.headers.get("Content-Type", ""): print(resp.json()) else: print(f"Status: {resp.status_code}")
Debug
Known issues
gotchaThe pip package name is irs-api but the import module uses an underscore: irs_api. Using 'import irs_api' not 'import irs-api'.
fix
from irs_api import IRS
affects: all
gotchaThis 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.
fix
Implement retry logic and fallback handling in case upstream IRS data sources change.
affects: all
deprecatedThe package has not been updated frequently. The last PyPI release is 0.0.3. API surface may be limited or stale.
fix
Check the GitHub repository for any open issues or forks with more recent updates before relying on this in production.
affects: all
gotchaRate limiting or IP blocking may occur if too many requests are made to IRS endpoints in a short period.
fix
Add delays between requests using time.sleep() and cache results locally to minimize repeated calls.
affects: all
Upgrade
Version history
N/Alatest on PyPI
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to IRS endpoints.
Agent activity
74 hits · last 30 days
node
8
seranking-bot
4
ahrefsbot
2
Resources

No resource links recorded.