Authentication

Authentication

All /v1/* endpoints require an API key. A handful of utility routes are public and require no authentication.

Public routes (no auth)

PathDescription
GET /healthHealth check, returns { ok: true, version: "…" }
GET /llms.txtCondensed API reference for AI agents
GET /llms-full.txtFull API reference for AI agents
GET /openapi.jsonOpenAPI 3.x spec

Public under /v1/ without a key: GET /v1/pricing, GET /v1/status, POST /v1/keys/provision. Everything else under /v1/ requires a valid API key.

Passing your API key

Send your key as a Bearer token. This is the form used on superscraper.dev and in the playground:

curl -H "Authorization: Bearer ss_live_xxxxxxxxxxxxxxxxxxxx" …

The x-api-key header works the same way, and most examples in these docs use it:

curl -H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" …

Use whichever your client makes easier. Both resolve to the same key. If a request sends both, x-api-key wins.

Any request that omits both headers returns:

HTTP 401
{ "error": "API key required. Pass via x-api-key header." }

Key format

Keys follow the pattern ss_<token>. The prefix is for visual identification only. Any active key is accepted. Keys are stored as SHA-256 hashes; the plaintext is only available at creation time.

Getting a key

Dashboard (normal flow)

  1. Sign in at app.superscraper.dev (opens in a new tab).
  2. Go to API Keys and click Create key.
  3. Copy the key immediately. It is shown only once.

Self-serve provisioning (agents / scripts)

POST /v1/keys/provision is public: it is mounted ahead of the auth guard, so it needs no existing key and no sign-in. It mints a fresh free-tier tenant and returns the plaintext key once:

curl -X POST https://api.superscraper.dev/v1/keys/provision \
  -H "Content-Type: application/json" \
  -d '{"label": "my-agent"}'
{
  "apiKey": "ss_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "tenantId": "8f3c…",
  "tier": "free"
}

Store apiKey immediately. It cannot be retrieved again. The route is IP rate-limited and issues free-tier keys only; to do paid work, fund credits from the dashboard.

Key lifecycle

StateBehaviour
ActiveAll /v1/* requests are allowed (subject to rate limits and tier quotas)
RevokedReturns HTTP 401 "Invalid or revoked API key." on every request

Keys can be revoked from the dashboard, or with an API key (below). Once revoked, they cannot be re-activated; create a new key instead.

Managing keys with an API key

A key from POST /v1/keys/provision has no dashboard sign-in, so the key itself can list, rotate and revoke the account's keys. Use self as the id for the key you are calling with.

# List keys: prefix, name, scopes, dates. Never the secret.
curl -H "x-api-key: $SUPERSCRAPER_API_KEY" https://api.superscraper.dev/v1/keys
 
# Rotate the calling key: the new key is returned once, the old key stops working.
curl -X POST -H "x-api-key: $SUPERSCRAPER_API_KEY" https://api.superscraper.dev/v1/keys/self/rotate
 
# Revoke a key. Revoking the calling key or the last active key needs ?confirm=true.
curl -X DELETE -H "x-api-key: $SUPERSCRAPER_API_KEY" "https://api.superscraper.dev/v1/keys/KEY_ID?confirm=true"
EndpointResult
GET /v1/keys{ "keys": [{ "id", "name", "key_prefix", "scopes", "expires_at", "created_at", "last_used_at", "current" }] }
POST /v1/keys/{id}/rotate201 { "id", "key", "key_prefix", "replaces", "revoked_current" }. The replacement keeps the old key's name and restrictions. If the old key cannot be revoked, the replacement is removed and nothing changes (409 or 500).
DELETE /v1/keys/{id}{ "id", "revoked": true, "revoked_current" }, or 409 confirm_required

Rules:

  • A key from another account answers 404, the same as a key that does not exist.
  • A key with endpoint scopes cannot use these endpoints (403 scope_not_allowed).
  • A key with an expiry, an IP allowlist or a privacy setting manages only itself.
  • A key a team member created manages only that member's keys.
  • Rotations and revocations are capped at 30 per account per hour (429 key_mutation_rate_limited).

Error responses

StatusJSONCause
401"API key required. Pass via x-api-key header."No key header present
401"Invalid or revoked API key."Key not found in database or is_active = false
403"This surface is not part of the developer API."The path belongs to an internal product surface. A developer key cannot reach it.
404{ "error": "Not found", "code": "not_found", "fix_hint" }The path is not available on the public API

Rate limits

Rate limits apply per account (all of its keys share one window), per 60-second sliding window:

PlanRequests / minute
Free10
Hobby60
Pro200
Scale600
Custom3 000

Exceeding the limit returns HTTP 429 with a Retry-After: 60 header.

Security notes

  • Keys are never logged. The server stores only the SHA-256 hash.
  • Plain HTTP requests are redirected to HTTPS. Always call https://: a redirected POST can lose its body.
  • Each request updates last_used_at on the key row (fire-and-forget, non-blocking).
  • Treat keys like passwords: do not commit them to version control or expose them client-side. Use environment variables (SUPERSCRAPER_API_KEY) in your applications.