New

FlowConsent, our own cookie banner, is live.

Rate limiting: plainly explained.

Rate limiting caps requests per client to protect APIs and login forms from overload. Definition, algorithms (token bucket, sliding window), best practices.

Webapp · Updated Nov 7, 2026

DEFINITION

Rate limiting caps how many requests a client can send to a server within a given time window, rejecting or delaying excess requests to protect the service.

CATEGORY

Webapp

RELATED

API, REST API

Summarize this page with AI

01

What is rate limiting?

Rate limiting is a technique that caps how many requests a client (a user, an API key, or an IP address) can send to a server within a given time window, and rejects or delays the requests that exceed that cap. It protects APIs, login forms, and search endpoints from being overwhelmed by traffic spikes, scraping, brute-force attempts, or a single misbehaving script, while keeping the service responsive for everyone else. Almost every public API applies some form of rate limiting, whether the caller notices it or not.

Unlike a hard outage, rate limiting is a deliberate, visible boundary: a well-designed API tells the caller exactly how many requests remain and when the limit resets, so legitimate integrations can back off and retry instead of failing silently. It also shows up outside pure software APIs: a contact form that blocks a visitor after ten submissions in a minute, or a search box that pauses autocomplete calls while the user is still typing, are both applying the same principle at a smaller scale.

02

How rate limiting works

A rate limiter tracks a counter per client key (often an API token or IP address) and compares it against a threshold before letting a request through. A typical HTTP response once the limit is hit looks like this:

HTTP/1.1 429 Too Many Requests
Retry-After: 30
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1758880000

The 429 status code signals that the request was valid but refused because the caller went over its quota; the accompanying headers tell the client how many requests it gets, how many are left, and when it can try again. A well-behaved client reads these headers and paces itself instead of hammering the endpoint immediately after being blocked. Rate limiting can be enforced at several layers at once: at the CDN or reverse proxy in front of the whole platform, at an API gateway per route, and inside the application itself for expensive operations such as file exports or bulk imports.

03

Common rate limiting algorithms

  • Fixed window: counts requests in fixed time blocks (e.g. per minute); simple, but allows a burst right at the boundary between two windows.
  • Sliding window: recalculates the count over a rolling time frame, smoothing out the boundary-burst issue of a fixed window.
  • Token bucket: a bucket refills with tokens at a steady rate; each request consumes a token, and bursts are allowed as long as tokens are available.
  • Leaky bucket: requests queue up and are processed at a constant rate, smoothing out bursts entirely rather than allowing them.

The choice between these algorithms is mostly a trade-off between implementation simplicity and how tolerant the system needs to be of short bursts: a token bucket suits APIs that expect occasional spikes from legitimate batch jobs, while a leaky bucket suits systems that must guarantee a strictly constant downstream processing rate, such as a payment queue.

04

Rate limiting vs throttling vs quotas

ConceptTime frame
Rate limitingShort window (seconds to minutes)Typical response429 error, request rejected or delayed
ThrottlingOngoing, adaptiveTypical responseRequest slowed down rather than rejected
QuotaLong window (day, month, billing cycle)Typical responseAccess blocked until the quota resets or is upgraded
05

Best practices and common pitfalls

  • Rate limit by a meaningful key (API token or authenticated user) rather than raw IP alone, since many legitimate users can share one IP behind a corporate network or mobile carrier.
  • Return clear 429 responses with Retry-After headers instead of a generic error, so client applications can implement exponential backoff automatically.
  • Set different limits per endpoint: a login route or a search box needs a tighter limit than a static asset request, since brute-force and scraping attempts concentrate there.
  • Avoid setting limits so aggressively that they break normal usage during traffic spikes from legitimate campaigns, launches, or press coverage; monitor and adjust based on real traffic patterns.
06

Why it matters for security and reliability

Without rate limiting, a single script or a coordinated attack can exhaust server resources, drive up infrastructure costs, and degrade the experience for every other user, in what is effectively a self-inflicted denial-of-service situation. Rate limiting is also a first line of defense against credential-stuffing attacks on login forms and against scrapers copying entire product catalogs or content libraries. On the infrastructure side, predictable request volumes make capacity planning and cost forecasting far more reliable, which matters as much for a small SaaS API as it does for a high-traffic e-commerce checkout during a seasonal sale.

07

Rate limiting at BeBranded

When we build custom APIs, integrations, or automation pipelines for clients, we configure rate limiting from day one, at the API gateway or application layer, so a traffic spike or a misconfigured integration never takes an entire system down. We size limits around real usage patterns rather than arbitrary defaults, and we surface clear error messages and retry guidance to integration partners, so a legitimate spike in usage gets throttled gracefully instead of breaking a client relationship. See our web apps service for how we design and secure these back-end systems.

FAQ

Questions about Rate limiting.

Another question?

Write to us
What is rate limiting used for?
It is used to protect APIs, login forms, and search endpoints from traffic spikes, scraping, and brute-force attempts by capping how many requests a client can send in a given time window.
What does a 429 error mean?
HTTP 429 Too Many Requests means the request was valid but refused because the caller exceeded its rate limit; the response usually includes a Retry-After header.
What is the difference between rate limiting and throttling?
Rate limiting rejects requests once a hard cap is hit, usually over a short window, while throttling slows requests down gradually rather than rejecting them outright.
Which rate limiting algorithm should I use?
Token bucket suits APIs that expect occasional legitimate bursts, while a sliding window or leaky bucket suits systems that need a strictly steady request rate.
Should rate limiting be based on IP address?
Not alone: many legitimate users can share one IP behind a corporate network, so rate limiting by API token or authenticated user is usually more accurate.
Does rate limiting hurt the user experience?
Only if limits are set too aggressively; well-tuned limits with clear 429 responses and Retry-After headers let legitimate traffic back off and retry smoothly.

Related

Related terms, and where to go next.

Response to the critical video on Low-code: debunking misconceptions and highlighting the true value of Low-Code
No-Code

Response to the critical video on Low-code: debunking misconceptions and highlighting the true value of Low-Code

Is Low-Code really too expensive, unscalable and difficult to collaborate on? We debunk the myths from Micode’s video and reveal how to use them the right way.

Read the article
How to create a Shopify store with Webflow: step-by-step guide
Webflow

How to create a Shopify store with Webflow: step-by-step guide

Want a fully customized online store with powerful e-commerce features? Discover how to integrate Webflow and Shopify to create a high-converting shop.

Read the article
BeBranded
Webflow

Webflow MCP: connect an AI agent to your site

Webflow MCP: what it is, what it enables, how to install it, concrete use cases, v1.2 updates, and limitations to know. Complete guide.

Read the article

Let’s talk

Tell us what you want to build.

Thirty minutes with the people who will work on your project. You leave with a clear view of the scope, the timeline and the next steps.

What happens next

  1. 1A 30-minute callWe listen to your goals, your constraints and your context.
  2. 2A clear scopeWe map what is worth doing first, and what it takes.
  3. 3A costed proposalYou decide, with no commitment and no sales pitch.