# laurentS/slowapi

A rate limiter for Starlette and FastAPI

Repository: https://github.com/laurentS/slowapi
Canonical: https://ross.abutalabs.com/products/slowapi
Homepage: https://pypi.org/project/slowapi/
Language: Python
License: MIT
License Family: permissive
Topics: starlette, fastapi, rate-limiter, asgi, python, uvicorn
Last push: 2026-08-26T19:34:29+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 56, longevity 100
- inputs: {"age_days": 2385, "days_push": 7, "days_rel": 81, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2052, forks 129 (observed 2026-08-28T04:06:09.678492+00:00)

## What it is
SlowAPI is a rate limiting library for Starlette and FastAPI, adapted from flask-limiter and built on top of the limits package. It supports decorator-based limits on endpoints with redis, memcached, or in-memory backends for tracking.

## Use cases
- rate limit fastapi endpoints
- throttle requests per minute in starlette
- add 429 responses to my api
- limit api usage with redis backend
- apply shared rate limits across multiple routes
- protect fastapi endpoints from abuse

## When to choose
- you use FastAPI or Starlette and need per-endpoint rate limiting
- you want flask-limiter-style limits in an ASGI app
- you need redis, memcached, or memory-backed limit tracking

## When to avoid
- you need websocket endpoint rate limiting
- you use Django or Flask (use flask-limiter or django-ratelimit instead)
- you need a fully async-native rate limiter without API change risk

## Facets
- artifact type: library
- maturity: stable
- function: rate-limiting, middleware, web-framework
- domain: web-development, backend, apis, security
- platform: python, cross-platform
- tags: fastapi, starlette, asgi, rate-limiter, redis, memcached, web-server

## Member repositories
- laurentS/slowapi (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:09.678492+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:57:26.492490+00:00, confidence not recorded.
  - readme: https://github.com/laurentS/slowapi (fetched 2026-08-28T04:06:09.678492+00:00, sha baf87b6d47d9)
  - homepage: https://pypi.org/project/slowapi/ (fetched 2026-08-29T10:38:07.255742+00:00, sha 4b4e8fead74a)
  - registry_pypi: https://pypi.org/pypi/slowapi/json (fetched 2026-08-29T10:38:07.258281+00:00, sha 669966da5df2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
