🔐 rlimit.com

rate limiting
made easy

Protect your serverless/edge APIs from abuse. Start rate-limiting expensive requests with a simple API today.

👉 👈
Control the number of :max requests made within a specified :interval, e.g. for each user :key
// GET /:namespace/:max/:interval/:key
=> 200 OK <=
{ok: true, remaining: 3}

🧑‍💻 Examples 🧑‍💻

configure, copy-paste, start limiting, all within minutes
1
const namespace = "example" // rlimit.com namespace ID
2
const key = "user:123" // identifier - user/account ID, IP, operation, etc
3
4
// limit $key to 10 requests every 30s
5
const limit = await fetch(`https://rlimit.com/${namespace}/10/30s/${key}`)
6
7
// or limit.status === 429
8
if (!limit.ok) {
9
// rate limited
10
// for example, reject request
11
}
1
export RATELIMIT_KEY="user:123" # identifier - user/account ID, IP, operation, etc
2
curl -X GET --fail "https://rlimit.com/example/10/30s/${RATELIMIT_KEY}"
3
# error with 'curl: (22) The requested URL returned error: 429' on rate limit
1
// middleware.ts
2
export const rateLimitMiddleware: MiddlewareHandler = async (c, next) => {
3
// read accountId from request path
4
const accountId = c.req.param("accountId")
5
6
// limit $accountId to 10 requests every 30s
7
const limit = await fetch(`https://rlimit.com/example/10/30s/${accountId}`)
8
9
if (!limit.ok) {
10
return c.text("too many requests", 429)
11
}
12
13
await next()
14
}
15
16
// router.ts
17
app.get("/api/:accountId/expensive-operation", rateLimitMiddleware, myHandler);
1
import requests
2
3
key = "user:123" # identifier - user/account ID, IP, operation, etc
4
5
# limit "user:123" to 10 requests every 30s
6
limit = requests.get("https://rlimit.com/example/10/30s/" + key)
7
8
if not limit.ok:
9
# rate limited
10
# for example, reject request
11
pass

✨ Analytics ✨

observability out of the box, check out this landing page (and GET button) stats below
  1. allowed

  2. blocked

Live events

monitor events as they happen, in real time
waiting for events

Simple pricing

Pay only for what you use, free tier available. Get started within minutes.

  • Simple GET API

  • Live events tail

  • Analytics

  • High availability

  • Webhooks

  • Global low latency

Pay as you go

$5/mo

2 million requests included+ $0.5/100k overage requests

Frequently Asked Questions

🔐 rlimit.com