Rate limits

Each API key has a token-bucket rate limit set by your plan. The sustained rate is the refill rate; burst is the bucket capacity — you can briefly exceed the sustained rate until the bucket drains. We always return Retry-After on a 429, so honest backoff is straightforward.

Per-plan limits

PlanSustained (req/min)
Free10
Monthly ($5/mo)60
Annual ($54/yr)120

The bucket refills continuously at the sustained rate, so short bursts above it are fine until the bucket drains.

Response headers

Every response includes the rate-limit headers so you can track headroom without waiting for a 429.

http
X-RateLimit-Limit: 40
X-RateLimit-Remaining: 34
Retry-After: 2

Retry-After is only present on 429 responses.

Handling 429s

Honor Retry-After. A reasonable default is exponential backoff bounded by the header value — don't sleep less than what we tell you to.

retry.mjs
async function callWithRetry(body, attempt = 0) {
  const res = await fetch("https://api.mentionsapi.com/v1/ask", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MENTIONSAPI_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
  });

  if (res.status === 429 && attempt < 4) {
    const retryAfter = Number(res.headers.get("Retry-After") ?? 1);
    const delay = Math.max(retryAfter * 1000, 2 ** attempt * 500);
    await new Promise((r) => setTimeout(r, delay));
    return callWithRetry(body, attempt + 1);
  }

  if (!res.ok) throw new Error(`MentionsAPI ${res.status}`);
  return res.json();
}

Tips

  • Cache hits don't count against the sustained rate — repeat queries scale freely.
  • A single fan-out across four providers is one request (one slot), not four.
  • Need higher throughput than your plan allows? Email [email protected] — we can usually accommodate short-duration burst patterns.