Rate limits

Each plan sets a rate in requests per minute: 20, 40 or 120. amodb counts requests in a sliding 60 second window. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit you get HTTP 429 with status_code 25 and a Retry-After header in seconds. Cached responses still count.

Limits by plan

Requests per minuteRequests per day at full rate
2028,800
4057,600
120172,800

Every plan includes the same endpoints and data. See pricing for the plan names and prices.

How the window works

amodb counts the requests of each key over the last 60 seconds. The window slides: a request made at 12:00:30 stops counting at 12:01:30. There is no reset at the top of the minute, so a steady rate works better than bursts.

The key check and the rate limit run before the edge cache. A response served from cache still counts as one request.

Response headers

Every call made with a key returns these headers:

HeaderMeaning
X-RateLimit-LimitRequests allowed per 60 seconds for this key.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetSeconds until the oldest counted request leaves the window.
Retry-AfterOn 429 only: seconds to wait before the next call.

When you hit the limit

The response is HTTP 429 with the TMDB error body:

Wait for Retry-After seconds, then retry. Do not retry in a tight loop.

JSON
{
  "success": false,
  "status_code": 25,
  "status_message": "Your request count (41) is over the allowed limit of (40)."
}
async function amodb(path) {
  for (let attempt = 0; attempt < 3; attempt++) {
    const res = await fetch(`https://api.amodb.dev${path}`, {
      headers: { Authorization: `Bearer ${process.env.AMODB_KEY}` },
    });
    if (res.status !== 429) return res.json();
    const wait = Number(res.headers.get("Retry-After") ?? 1);
    await new Promise((r) => setTimeout(r, wait * 1000));
  }
  throw new Error("amodb: still rate limited after 3 attempts");
}
import os
import time
import requests

def amodb(path):
    for _ in range(3):
        res = requests.get(
            f"https://api.amodb.dev{path}",
            headers={"Authorization": f"Bearer {os.environ['AMODB_KEY']}"},
            timeout=10,
        )
        if res.status_code != 429:
            return res.json()
        time.sleep(int(res.headers.get("Retry-After", "1")))
    raise RuntimeError("amodb: still rate limited after 3 attempts")

Stay under the limit

  • Cache responses on your side. Details change rarely; 6 hours is a safe default.
  • Use append_to_response to get details, credits and images in one request instead of three.
  • Spread batch jobs: at 40 requests per minute, send one request every 1.5 seconds.
  • Read X-RateLimit-Remaining and slow down before it reaches 0.