SerpBase

Responses & errors

Every answer is JSON with the same envelope. Success or failure is in its status field, not in the HTTP status: check status, then read the result.

Common response envelope

Successful endpoint responses return the same top-level metadata. Endpoint-specific data lives in one result key such as organic, images, news, videos, places, or place.

status
required
number

required

Business status code. 0 means success.

request_id
required
string

required

Stable request identifier for support, retries, and log correlation.

elapsed_ms
required
number

required

Gateway-observed execution duration in milliseconds.

credits_charged
required
number | null

required

Actual credits charged after refund logic. null or charge_status: unknown means the charge is not confirmed.

search_type
optional
string

optional

Product-specific response type, when returned by the product.

Errors
error
required
string

required

Human-readable failure message.

0
SUCCESS

Request completed successfully. Inspect product-specific outcome fields; no_results alone is not proof of HTTP 404.

Charged

1000
INVALID_REQUEST

Missing or invalid body or parameters.

Not chargedFix the request first

1001
UNAUTHORIZED

Missing, invalid, or revoked API key.

Not chargedFix the request first

1004
NOT_FOUND

Resource not found on gateway routing or catalog.

Not chargedFix the request first

1020
INSUFFICIENT_CREDITS

Account balance is not enough.

Not chargedFix the request first

1029
RATE_LIMITED

QPS or concurrency limit exceeded.

Not chargedSafe to retry

1500
INTERNAL_ERROR

Unexpected internal server error.

Not chargedSafe to retry

1502
UPSTREAM_FAILED

Worker returned an upstream fetch or parse error.

Not chargedSafe to retry

1503
SERVICE_UNAVAILABLE

No worker session is available.

Not chargedSafe to retry

1504
UPSTREAM_TIMEOUT

Gateway timed out waiting for a worker result.

Not chargedSafe to retry

JSON
{
  "status": 1001,
  "error": "unauthorized",
  "request_id": "0f3576b2-6e2e-4f1e-bb0e-8cb0d4a60195",
  "elapsed_ms": 0,
  "credits_charged": 0
}
Response headers

Every product response carries these headers so your client can pace itself and decide whether to retry without parsing the message.

X-RateLimit-Limit
Requests per second your account allows.
X-RateLimit-Remaining
Requests still allowed in the current second.
Retry-After
On a refusal, how many seconds to wait before sending again.
X-SerpBase-Retryable
true when resending the same request can succeed; false when the request itself must change.
When you contact support
Include the request_id from the response (every success and every failure has one) and the time of the call. With it we can find the exact request in seconds; without it we have to ask.
Privacy and retention
Search queries may be logged for billing, debugging, abuse prevention, and account logs. See the privacy page for retention details.