Errors & retries

Every error has the same shape and a stable code. Branch on the code, show the message, and retry only what is worth retrying.

Embed
Preview of the card
<a href="https://scrapelyserp.com/docs/errors"><img src="https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/pages/bf6fccb4-a847-4fcb-8b1e-9ca331cd0bce/social-card.svg?v=3e7ae33eec8b" alt="Errors &amp; retries" width="600" height="315"></a>

Every error has the same shape and a stable code. Branch on the code, show the message, and retry only what is worth retrying.

Error shape

An error is any non-2xx answer, and its body is always { "error": { "code", "message", "param", "docs" } }.

Field

Description

code

Stable and machine-readable. Branch on it.

message

For humans: says exactly what was expected. May be reworded.

param

The parameter at fault, when there is one (ids[3], every, url…).

docs

A link to the code's entry below.

Coming-soon platforms, marketplaces and endpoints add "coming_soon": true to a 501. Item-level failures are not errors: they are statuses inside a 200 (Responses & statuses).

When to retry

Answer

Retry?

How

CONCURRENCY_LIMIT, RATE_LIMITED, TARGET_FAILED, UNAVAILABLE, INTERNAL

Yes

Exponential backoff (1 s, 2 s, 4 s…), honouring Retry-After when present. Nothing was charged.

400, 401, 402, 403, 404

No

Change something first: the parameter, the key, the balance or the id.

409 CONFLICT

Sometimes

A run or an idempotent create still in progress: retry in a few seconds. A per-account limit: delete something first.

Items unavailable or partial

Yes, those items only

Send them again in a later call. A retry pays only for what it moves.

Retries never double-charge

A refused call charges nothing, and requests that got no answer, were blocked or errored are never billed, so retrying is always safe for item calls: you pay only for what each attempt actually pulled. For POST /v1/watchlists, send an Idempotency-Key so a retried create cannot make a second list.

Codes

Code

HTTP

Meaning

MISSING_PARAM

400

Missing parameter

INVALID_PARAM

400

Invalid parameter

UNAUTHORIZED

401

Unauthorized

DEMO_READ_ONLY

403

Demo workspace

FORBIDDEN

403

Not allowed

INSUFFICIENT_CREDITS

402

Insufficient credits

SUBSCRIPTION_REQUIRED

402

Monitoring subscription required

PLAN_REQUIRED

402

Plan required

NOT_FOUND

404

Not found

GONE

410

Gone

CONFLICT

409

Conflict

CONCURRENCY_LIMIT

429

Concurrency limit reached

RATE_LIMITED

429

Rate limited

TARGET_FAILED

502

Target failed

UNAVAILABLE

503

Temporarily unavailable

NOT_IMPLEMENTED

501

Not implemented

INTERNAL

500

Internal error

MISSING_PARAM {#missing_param}

HTTP 400 · Missing parameter. A required parameter was not sent. param names it.

What to do

Add the parameter. JSON bodies need Content-Type: application/json.

INVALID_PARAM {#invalid_param}

HTTP 400 · Invalid parameter. A parameter was sent but its value is not accepted: wrong type, out of range, an unsupported marketplace, a private webhook URL, an entry in the id list that is not a valid id on that platform (param is then the list and its index, e.g. ids[i], asins[i] on Amazon), or two options that cannot be combined. param names it.

What to do

Read message: it says exactly what is expected.

UNAUTHORIZED

HTTP 401 · Unauthorized. No API key was sent, or the key is unknown or revoked.

What to do

Send your key as Authorization: Bearer <key>, X-API-Key: <key> or ?api_key=<key>. Keys are in the dashboard under Developers → API keys.

DEMO_READ_ONLY {#demo_read_only}

HTTP 403 · Demo workspace. The key belongs to the public, read-only demo workspace. It can be seen in the dashboard but cannot make requests or spend credits.

What to do

Create an account and use your own API key.

FORBIDDEN

HTTP 403 · Not allowed. The request is understood but refused: on Discord, the role is at or above the bot's highest role, carries permissions, is managed by an integration or is @everyone; the channel or role was not created through the API (only those can be deleted); or the bot lacks the Discord permission it needs.

What to do

Read message. For a missing bot permission, open the server's reauthorize_url (GET /v1/discord/servers/{guild_id}) and approve the bot again. For roles, move the bot's role above the role in Server Settings → Roles.

INSUFFICIENT_CREDITS {#insufficient_credits}

HTTP 402 · Insufficient credits. Your balance cannot cover this request's estimate, worked out from its unique items and the tier's items per credit (the message says both, in credits). Nothing was charged. A call is all-or-nothing: the whole estimate must be covered.

What to do

Buy a credit pack (credits never expire), send fewer items per call, or enable auto top-up in Billing.

SUBSCRIPTION_REQUIRED {#subscription_required}

HTTP 402 · Monitoring subscription required. Creating, resuming or running a watchlist needs an active monitoring subscription (a canceled one keeps working until the end of its paid period). The pay-per-use API does not. Nothing was created, run or charged.

What to do

Choose a monitoring plan in the dashboard (Monitors). Its monthly credits are spent before your purchased credits.

PLAN_REQUIRED {#plan_required}

HTTP 402 · Plan required. The feature needs a higher monitoring plan: custom alert branding (your own name, icon, link and footer instead of the Scrapely footer) is on the Growth and Pro plans. Nothing was saved.

What to do

Move to the Growth or Pro plan in the dashboard (Monitors), or send the template without branding.

NOT_FOUND {#not_found}

HTTP 404 · Not found. The endpoint, watchlist, webhook endpoint or structured endpoint does not exist, or belongs to another account.

What to do

Check the id and the path. The API reference lists every endpoint.

GONE

HTTP 410 · Gone. The endpoint was retired and will not come back. The generic URL scraper (/v1/scrape, /v1/jobs, /v1/batches) answers this: Scrapely serves retailer data only.

What to do

Use the product API, POST /v1/products, with a platform, a marketplace and item ids; watchlists (/v1/watchlists) run it on a schedule.

CONFLICT

HTTP 409 · Conflict. The request conflicts with the resource's current state: a request with the same Idempotency-Key is still in progress, a watchlist that is already running was asked to run again, or a per-account limit was reached.

What to do

Retry idempotency and run conflicts after a few seconds; for limits, delete something first.

CONCURRENCY_LIMIT {#concurrency_limit}

HTTP 429 · Concurrency limit reached. All of your concurrent request slots are busy. The request was refused immediately and nothing was charged.

What to do

Retry with backoff. Concurrency grows with lifetime credits purchased.

RATE_LIMITED {#rate_limited}

HTTP 429 · Rate limited. Too many API calls with this key in a short window. Separate from concurrency: this counts calls, including cheap ones such as listing watchlist changes.

What to do

Wait Retry-After seconds. Prefer webhooks to polling in a tight loop.

TARGET_FAILED {#target_failed}

HTTP 502 · Target failed. We could not get a usable answer from the retailer after our retries: it blocked us, rate-limited us, errored, or never responded. You were not charged.

What to do

Retry with backoff. Items that fail inside a successful call come back unavailable; requests that got no answer, were blocked or errored are never charged.

UNAVAILABLE

HTTP 503 · Temporarily unavailable. A dependency on our side is down or overloaded. Nothing was charged.

What to do

Retry with exponential backoff. Status updates at /status.

NOT_IMPLEMENTED {#not_implemented}

HTTP 501 · Not implemented. The platform, marketplace, endpoint or option is announced but not available yet. It answers with "coming_soon": true (structured endpoints also with "message": "Coming soon"); nothing is charged.

What to do

Use a live platform and marketplace (GET /v1/platforms lists them) with POST /v1/products. Contact support if you need something sooner.

INTERNAL

HTTP 500 · Internal error. Something failed on our side. Nothing was charged, and the failure was logged with your X-Request-Id.

What to do

Retry. If it persists, contact support with the X-Request-Id header value.

Updated