Skip to main content

Overview

Rate limits protect Snipp from abuse and keep performance consistent for everyone. Limits apply per user, per endpoint, except where endpoints are marked as sharing a bucket below.

API Limits

Relay Limits

Relay has the same limits for the endpoints above, plus these Relay-only endpoints: GET /posts/{code} and GET /discover on Relay count views. Views are deduplicated per IP and post: up to 3 counted views per IP per post per hour. See the Relay Reference for what Relay covers and how to authenticate.

Rate Limit Headers

Rate-limited responses include headers to help you track your usage: Endpoints with no limit do not include these headers.

Rate Limit Responses

When you exceed the limit, the API returns HTTP status 429 with type rate_limited and a Retry-After header:
The rate limit headers are still included on 429 responses so you know when to retry.

Weekly Usage Limit Responses

Separate from per-endpoint rate limits, every account has a weekly usage limit. A file that would push you over it is rejected before it is stored, with type quota_exceeded and three context fields:
  • On POST /upload and POST /posts/{code}/files, when at least one other file was stored, the response is 200 and the rejected file is listed in failed with this error object.
  • When the only file in the request is rejected, the response is 400 with the error above at the top level.
  • When every file of a multi-file request fails, the response is 400 with type upload_failed, and each file’s quota_exceeded error sits in failed. See Partial upload failures.
  • A personal-key request whose declared Content-Length already exceeds your weekly quota is refused with 413 and type file_too_large before any file is read. Team keys are only checked against the per-file limit.
Check your remaining usage anytime via GET /users/@me (limits.usage).

Handling Rate Limits

1

Check the headers

Read X-RateLimit-Remaining from each response. When it approaches 0, slow down.
2

Detect the 429 status

Check for HTTP status 429 in your API responses.
3

Wait until reset

Use the Retry-After header on the 429 as the wait time in seconds, or calculate it from X-RateLimit-Reset.
4

Use exponential backoff

If requests continue to fail, double the wait time with each retry (for example, 1s, 2s, 4s, 8s).

Best Practices

  • Space out bulk uploads. When uploading multiple files, add a short delay between each request rather than sending them all at once.
  • Cache user data. Avoid calling /users/@me repeatedly. Fetch it once and reuse the result for the duration of your session.
  • Batch where possible. Reduce the total number of API calls by combining logic on your end instead of making multiple requests for related data.
  • Monitor your usage. If you consistently hit rate limits, consider whether your integration can be optimized to make fewer requests.