aiohttp-retry
Simple retry client for aiohttp
Decision gist · record as of 2026-08-14
Yes. It is low-friction to install, actively maintained, has no known vulnerabilities, and solves a common problem in async HTTP clients. Use it if you need automatic retry logic for aiohttp; it is simpler than implementing retries manually. Be aware of the breaking API changes noted in versions 2.7.0–2.8.3 (yanked) and the parameter addition in 2.5.6 if you are upgrading from an older version.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or higher and an async context (asyncio event loop).
- Low friction—pure Python wheel with a single runtime dependency on aiohttp.
- Actively maintained as of 2024-11-06, with 273 repository stars and recent commits.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
last release 2024-11-06 (646 days) · last repo commit 2026-04-08 · 273 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 37,263,239 downloads/mo, #727 on PyPI
Alternatives
Verify before relying
from aiohttp_retry import RetryClient, ExponentialRetry
async def main():
retry_options = ExponentialRetry(attempts=3)
async with RetryClient(retry_options=retry_options) as client:
async with client.get('https://example.com') as response:
print(response.status)- Whether the package handles connection pooling and session lifecycle the same way as bare aiohttp.ClientSession.
- Performance overhead of retry logic compared to raw aiohttp requests.
- Behavior when evaluate_response_callback is combined with raise_for_status=True.
What it is and what it does
aiohttp-retry is a thin wrapper around aiohttp's ClientSession that adds automatic retry logic for failed HTTP requests. It lets you define retry policies (how many attempts, which status codes or exceptions trigger a retry, and how long to wait between attempts) and applies them transparently to all requests made through the RetryClient. The package includes several built-in backoff strategies—exponential, random, Fibonacci, and jitter—and allows custom logic via callbacks to decide whether a response warrants a retry.
You use it by creating a RetryClient with your chosen RetryOptions, then call its methods (get, post, etc.) exactly as you would with aiohttp's ClientSession. By default it retries all 5xx server errors plus any statuses you specify, and can also retry on specific exceptions. The last request attempt always returns as-is; if it fails, that failure propagates to your code. It integrates with aiohttp's trace mechanism so you can log or monitor retry attempts.
Use it for
- Retry transient 5xx errors from unreliable APIs without manual try-catch loops.
- Implement exponential backoff for rate-limited endpoints to avoid hammering servers.
- Handle temporary network glitches by retrying with jitter to prevent thundering herd.
- Change request parameters (URL, headers) between retry attempts for fallback strategies.
- Log or monitor retry attempts via aiohttp's trace config for observability.
- Retry on custom response conditions (e.g., malformed JSON) using evaluate_response_callback.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
It is low-friction to install, actively maintained, has no known vulnerabilities, and solves a common problem in async HTTP clients. Use it if you need automatic retry logic for aiohttp; it is simpler than implementing retries manually. Be aware of the breaking API changes noted in versions 2.7.0–2.8.3 (yanked) and the parameter addition in 2.5.6 if you are upgrading from an older version.
Install
aiohttp-retry on PyPI
Before you install
Low friction—pure Python wheel with a single runtime dependency on aiohttp. Actively maintained as of 2024-11-06, with 273 repository stars and recent commits. No known vulnerabilities.
Requires Python 3.7 or higher and an async context (asyncio event loop).
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
from aiohttp_retry import RetryClient, ExponentialRetry
async def main():
retry_options = ExponentialRetry(attempts=3)
async with RetryClient(retry_options=retry_options) as client:
async with client.get('https://example.com') as response:
print(response.status)
Verify before relying
- Whether the package handles connection pooling and session lifecycle the same way as bare aiohttp.ClientSession.
- Performance overhead of retry logic compared to raw aiohttp requests.
- Behavior when evaluate_response_callback is combined with raise_for_status=True.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageaiohttp |
| Maintenance | Actively maintained 646 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 37,263,239 / month, #727 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: aiohttp_retry-2.9.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “aiohttp retry client”
- aiohttp-retryWraps aiohttp's ClientSession to automatically retry failed HTTP…
- aioresponsesMocks HTTP requests made by aiohttp's ClientSession for testing…
- httpx-aiohttpProvides aiohttp-based transports for httpx, allowing httpx to use…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also aiogithubapi · retry-requests · retry2 · python-retry · retrying · retry · reretry · retryhttp · httpx-retries · backoff