skillfed

httpx-limiter

A lightweight package that provides rate-limited httpx transports.

httpx-limiter v0.6.1 82.0K downloads/30d#14,189 on PyPI48
Permissive license Apache-2.0 Active released

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-limiter

uv

uv add httpx-limiter

poetry

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 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

Development Status :: 2 - Pre-AlphaEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTyping :: Typed

Tags

httpx rate limitingrate limiter for httpxasync http rate limitleaky bucket rate limiterrequest throttling httpxconcurrent rate limitshttp transport limiter
rate-limitingasync-httpleaky-bucket

More WWW/HTTP packages