--- id: httpx-limiter version: "0.6.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # httpx-limiter — A lightweight package that provides rate-limited httpx transports. License: permissive · Maintenance: active · Downloads: 82.0K/mo ## 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 above — 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 pip install httpx-limiter uv add httpx-limiter poetry add httpx-limiter ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 82.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags httpx rate limiting, rate limiter for httpx, async http rate limit, leaky bucket rate limiter, request throttling httpx, concurrent rate limits, http transport limiter, rate-limiting, async-http, leaky-bucket [View on SkillFed](https://skillfed.io/packages/httpx-limiter) · [View on PyPI](https://pypi.org/project/httpx-limiter/)