7 releases (4 breaking)

0.5.0 Jan 9, 2026
0.4.1 Apr 29, 2025
0.3.0 Jan 9, 2025
0.2.0 May 4, 2024
0.1.1 Sep 28, 2023

#361 in HTTP client

Download history 582/week @ 2025-12-19 453/week @ 2025-12-26 1221/week @ 2026-01-02 1284/week @ 2026-01-09 1392/week @ 2026-01-16 1029/week @ 2026-01-23 1737/week @ 2026-01-30 2228/week @ 2026-02-06 1568/week @ 2026-02-13 1517/week @ 2026-02-20 988/week @ 2026-02-27 1044/week @ 2026-03-06 1059/week @ 2026-03-13 1267/week @ 2026-03-20 1063/week @ 2026-03-27 1197/week @ 2026-04-03

4,766 downloads per month
Used in 2 crates

MIT license

10KB

Middleware to rate-limit requests built on reqwest_middleware.

You're expected to provide your own RateLimiter implementation.

Example


reqwest-ratelimit

Rate-limit middleware implementation for reqwest-middleware.

This crate is glue code for implementing custom ratelimiters. For a batteries included example please refer to reqwest-leaky-bucket.

Crates.io Docs.rs

Usage

use std::future::Future;
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};

struct RateLimiter;

impl reqwest_ratelimit::RateLimiter for RateLimiter {
    async fn acquire_permit(&self) {
        // noop
    }
}

async fn run() {
    let client = ClientBuilder::new(reqwest::Client::new())
        .with(reqwest_ratelimit::all(RateLimiter))
        .build();

    client.get("https://crates.io").send().await.unwrap();
}

Dependencies

~3.5–10MB
~161K SLoC