httpx-limiter
A lightweight package that provides rate-limited httpx transports.
What it is and what it does
httpx-limiter wraps httpx's async HTTP client with rate-limiting transports that enforce request quotas. It sits between your client and the network, intercepting requests to ensure they respect configured rate limits—useful when calling APIs that have strict quotas or when you need to avoid overwhelming downstream services.
The package offers two backend implementations: aiolimiter (lightweight, single rate limit per transport) and pyrate-limiter (supports multiple concurrent limits, e.g., 10 per second and 100 per minute). You can apply a single global rate limit to all requests or use a repository pattern to assign different limits based on request properties like domain. The leaky bucket algorithm governs token refresh, with important caveats about burst behavior documented in the package.
Use it for:
- Throttle requests to a rate-limited API endpoint to stay within its quota without manual backoff logic.
- Apply different rate limits to different domains when making concurrent requests to multiple services.
- Enforce both per-second and per-minute rate limits simultaneously on a single client.
- Prevent request bursts by configuring magnitude and duration to allow only one request at a time.
- Integrate rate limiting into async web scraping or data collection pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides rate-limited HTTP transports for httpx clients, supporting both single and multiple concurrent rate limits through pluggable backend implementations.
Yes, if you need async rate limiting for httpx. Install friction is low, maintenance is active, and the license is permissive. The pre-alpha status (Development Status :: 2) means the API may change, so pin the version in production. No known vulnerabilities. Choose this if you're already using httpx and need straightforward rate limiting; if you need synchronous rate limiting, this package does not support it.
Install
httpx-limiter on PyPI
pip
pip install httpx-limiteruv
uv add httpx-limiterpoetry
poetry add httpx-limiterInstalling httpx-limiter
Before you install
Low friction install with only two runtime dependencies (httpx and typing-extensions). Active maintenance with recent commits and no known vulnerabilities. Pre-alpha status indicates the API may still evolve.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install httpx-limiter
import httpx
from httpx_limiter import AsyncRateLimitedTransport, Rate
from httpx_limiter.pyrate import PyrateAsyncLimiter
limiter = PyrateAsyncLimiter.create(Rate.create(magnitude=20))
async with httpx.AsyncClient(
transport=AsyncRateLimitedTransport.create(limiter=limiter)
) as client:
response = await client.get("https://example.com")
Requires Python 3.10 or later; async/await context required; pyrate-limiter backend depends on multiprocessing which may not be available in all environments.
Verify before relying
- Whether aiolimiter backend is available as an optional extra and what its availability constraints are.
- Specific behavior differences and performance characteristics between aiolimiter and pyrate-limiter backends in production scenarios.
- Whether the pre-alpha status indicates planned breaking changes to the public API.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — httpx, typing-extensions |
| Maintenance | actively maintained — 105 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,010/month — #14,189 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: httpx_limiter-0.6.1-py3-none-any.whl
Keywords: httpx, leaky bucket, limiter, rate-limit
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
httpxthrottlecacheWraps HTTPX with built-in rate limiting and…
unclear · top 15,000 on PyPI
requests-ratelimiterAdds rate-limiting to the requests library by…
permissive · top 5,000 on PyPI
asynciolimiterProvides rate limiting for async Python code by…
permissive · top 5,000 on PyPI
pyrate-limiterPyrateLimiter implements the Leaky-Bucket…
permissive · top 5,000 on PyPI
fastapi-limiterAdds request rate limiting to FastAPI routes…
permissive · top 5,000 on PyPI
rushrush provides rate-limiting algorithms…
permissive · top 15,000 on PyPI
Flask-LimiterFlask-Limiter adds rate limiting to Flask…
permissive · top 1,000 on PyPI
aiolimiterImplements a rate limiter for asyncio using the…
permissive · top 5,000 on PyPI
limitsImplements rate limiting with multiple…
permissive · top 1,000 on PyPI
aiometeraiometer is a concurrency scheduling library…
permissive · top 15,000 on PyPI