SerpBase
Back to Blog

SERP API Error Codes: What Each Status Means and Which to Retry

Every response is HTTP 200 with a status field. The codes we triggered on purpose (1000, 1003, 1004, 1502, 1504) with their exact messages, and one function that handles them all.

November 29, 2026
By SerpBase Team4 min read

Short answer: every response is HTTP 200 with a status field. 0 is success; 1000–1029 mean the request must change (or wait); 1500–1504 mean the same request can be sent again. The response header X-SerpBase-Retryable says which of the two it is, so a client never has to parse the message.

Below are the codes we triggered on purpose on 29 November 2026, with the exact messages, followed by the ones we did not trigger.

Codes we triggered

All of these answered HTTP 200 with credits_charged 0.

What we sentstatuserrorRetryable header
/google/search with no q1000query is required and must not be emptyfalse
/google/search with "tbs":"lastweek"1000invalid or conflicting search parameter: tbsfalse
/google/trends with six terms1000Trends supports at most five compared query termsfalse
An endpoint the docs mark as Paused1003forbiddenfalse
A path that does not exist (/google/nothing)1004no product is registered at /google/nothing...false
/google/search with "timeout":11504upstream request timed outtrue
/google/resolve, one call out of four1502upstream service error; retry shortlytrue, with Retry-After: 1

Two details from those runs:

  • The 1000, 1003 and 1004 refusals came back at once (elapsed_ms 0). The 1504 came back after 1,002 ms: the one-second budget we asked for, then an immediate answer.
  • The 1502 on the resolver arrived in a tenth of a second. The identical call a few minutes later returned all ten links.

A missing or wrong key gives 1001; those messages are in the API key guide.

A failure looks like this

{
  "status": 1000,
  "error": "query is required and must not be empty",
  "request_id": "r-a21e54f7b5e0eb9039dbe7c7",
  "elapsed_ms": 0,
  "credits_charged": 0
}

request_id is on every answer, success or failure. Quote it when you ask support about a request.

Codes we did not trigger

From the responses and errors docs:

statusMeaningWhat to do
1020Not enough creditsTop up; do not retry
1029Over your requests per secondWait the Retry-After seconds, then resend
1500Unexpected error on our sideResend
1503The endpoint cannot take the request right nowResend after a short wait

None of the failures is charged.

Python: one function that handles all of them

import time, requests

API = "https://api.serpbase.dev"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}

class ApiError(Exception):
    pass

def call(path, body, tries=3):
    for attempt in range(tries):
        resp = requests.post(API + path, headers=HEADERS, json=body, timeout=60)
        data = resp.json()
        if data["status"] == 0:
            return data
        retryable = resp.headers.get("X-SerpBase-Retryable") == "true" or data["status"] == 1029
        if not retryable or attempt == tries - 1:
            raise ApiError(f'{data["status"]} {data.get("error")} ({data.get("request_id")})')
        time.sleep(float(resp.headers.get("Retry-After", 1 + attempt)))

try:
    call("/google/search", {"gl": "us"})
except ApiError as e:
    print("refused:", e)

r = call("/google/search", {"q": "coffee shops", "gl": "us", "hl": "en"})
print("ok:", len(r.get("organic", [])), "organic results,", r["credits_charged"], "credit")

Our run printed refused: 1000 query is required and must not be empty (r-26d1...) and then ok: 7 organic results, 1 credit.

Things that trip people up

  • response.ok is always true. The HTTP status is 200 for failures too. Test data["status"] == 0.
  • Success can be empty. A search Google has no results for is status 0 with no_results true, and it is charged. That is an answer, not an error.
  • Do not retry 1000–1020. The same request will fail the same way. Read error: it names the parameter.
  • 1003 on one endpoint is not a key problem. In our test the key worked everywhere else; the endpoint was one the docs list as paused. Check the endpoint's docs page.
  • Keep your HTTP timeout at 60 seconds. If the client hangs up first you get neither a result nor a status. To get an answer sooner, send the timeout parameter (1–30 seconds) on Google search and you receive 1504 when it runs out. Background: what timeout to set.
  • Cap the retries. Three attempts with a short pause is enough; an endless loop on 1502 just burns your rate limit.

Related

Pacing and the 1029 code are covered in the API keys and rate limits docs. The machine-readable list of every endpoint and schema is in the OpenAPI file.

Cost and limits

Failed requests cost nothing. Successful Google searches are 1 credit; credits cost $0.25–$0.50 per 1,000 depending on the plan, and new accounts get 500 free credits without a card.