Skip to content
masterclass Buddy

Upstash · Function

slidingWindow

Sliding Window rate limiting weighs requests from the previous window together with requests in the current window. It reduces boundary bursts but uses more storage and computation.

Last updated

Syntax

Ratelimit(redis=Redis.from_env(), limiter=SlidingWindow(max_requests=10, window=10))

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Fixed Window
  • Token Bucket
  • Ratelimit
  • block_until_ready
  • Custom Rates

Source: Ratelimit Python SDK Algorithms - Upstash Documentation. Checked 2026-11-03.