skillfed

httpx-retries

A retry layer for HTTPX.

httpx-retries v0.6.0 4.7M downloads/30d#2,246 on PyPI76
Permissive license Active released

What it is and what it does

httpx-retries wraps HTTPX's transport layer to automatically retry failed requests with configurable backoff strategies. It's designed to handle flaky and unreliable APIs by retrying on transient failures, similar to urllib3's Retry utility but built for HTTPX's sync and async clients. The package provides sensible defaults for simple use cases (just wrap your client with RetryTransport) and a Retry configuration object for customizing total retry count, backoff factor, and backoff strategy.

The library is in Beta status and supports Python 3.10 through 3.14. It depends only on httpx and installs as a pure Python wheel. One known limitation: errors that occur while reading the response body (such as ReadTimeout mid-download) happen after the transport returns, so they cannot be retried by the transport itself—the package provides separate helper functions for that case.

Use it for:

  • Wrap an HTTPX client with default retry behavior to handle transient network failures without custom logic.
  • Configure a Retry policy with specific backoff and total retry limits for APIs known to be flaky.
  • Use async retry transport with AsyncClient for concurrent requests that need resilience to temporary failures.
  • Migrate from requests + urllib3 Retry to HTTPX with minimal API changes using the compatible Retry configuration.
  • Build a resilient scraper or data-fetching service that retries on connection timeouts and transient errors.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds automatic request retry logic to HTTPX, with configurable backoff strategies and support for both sync and async clients.

Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a common problem (request retry) in a way that mirrors familiar patterns from urllib3 and requests. The MIT license imposes no restrictions. Install it if you use HTTPX and need retry behavior; the defaults work out of the box.

Install

httpx-retries on PyPI

pip

pip install httpx-retries

uv

uv add httpx-retries

poetry

poetry add httpx-retries

Installing httpx-retries

Before you install

Low friction: pure Python wheel, single runtime dependency on httpx. Active maintenance with recent release (39 days ago) and steady repository activity.

License in practice

MIT license (permissive); no restrictions on commercial or private use.

Quickstart

pip install httpx-retries

import httpx
from httpx_retries import RetryTransport

with httpx.Client(transport=RetryTransport()) as client:
    response = client.get("https://example.com")

Requires Python 3.10 or later; httpx must be installed separately.

Verify before relying

  • Whether ReadTimeout errors during response body download are handled by the retry_request / aretry_request helpers mentioned in the docs.
  • Performance overhead of the retry transport compared to raw httpx under normal (non-failure) conditions.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — httpx
Maintenance actively maintained — 39 days since the last release
Last repo commit
First released
Downloads 4,714,169/month — #2,246 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: httpx_retries-0.6.0-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: AsyncIOFramework :: TrioIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP

Tags

httpx retry transporthttp request retry layerautomatic retry with backoffflaky api retry handlerhttpx resilienceasync http retryconfigurable request retries
http-clientresilienceasync-support

More WWW/HTTP packages