Skip to main content

Debugging SERP API

Use the x-brd-debug response header to extract detailed debug information about your requests. Activate by appending -debug-full to your proxy username:
The x-brd-debug response header will look like this:

Common Error Codes

Example 429 response

SERP API error catalog

Fast SERP runs inside the SERP API and shares its error codes. When a request fails, the error code is returned in the x-brd-error-code response header and a human-readable message in x-brd-error, as shown in the examples below. None of the errors in this catalog are billed.

HTTP Error 502

A 502 means the request failed due to an issue on Bright Data’s side. Read the error code to tell them apart.
Example query mismatch response

HTTP Error 429

A 429 means a rate limit was reached. Read the error code to tell them apart.
Example rejected query response
Because client_10110 uses the proxy-layer headers, read both when handling a 429:
sr_rate_limit and bucket_rate_limit responses also state the limit that was applied:

Handling query mismatches (unexpected_q)

By default, when Bright Data detects that Google returned results for a different query than the one you sent, the request returns the unexpected_q error and you are not billed. If you prefer to receive the mismatched data and validate it yourself, enable return_mismatch:
  • Proxy requests - add the request header:
  • API requests - add to the request body:
With return_mismatch enabled, mismatched responses are returned as successful requests and are billed. Validate them using the fields described in the next section.

How to detect query truncation

Google sometimes returns results for a shorter version of your query than the one you sent. For example, a search for pizza in tlv can return results for pizza. This behavior applies to both the SERP API and Fast SERP text (web) search. By default these responses return the unexpected_q error (see above). If you enabled return_mismatch, validate each response yourself by comparing general.query with general.detected_query, then checking for a spelling object to tell a genuine spelling correction apart from a truncated search:
  1. If general.query and general.detected_query match, Google searched exactly what you sent.
  2. If they differ, check for a spelling object:
    • spelling present - Google auto-corrected the spelling and the results are valid for the corrected query.
    • spelling absent - Google truncated (cloaked) your query and the results are for a shorter version of what you searched.
The example below shows an auto-corrected query, where detected_query differs from query but a spelling object confirms the results are valid:
For the general and spelling field definitions, see Parsed JSON results for the SERP API or Fast SERP web search for Fast SERP.

What happens when a query is blocked

When Bright Data detects that Google has flagged a query, that exact query is blocked across the SERP API and Fast SERP for 15 seconds. Any request for the same query during that window returns the failed_query_rejected error (or repeat_query_rejected if the query was throttled for being repeated). Retry the query after the 15-second window, or vary the query, to receive results. Repeatedly hammering flagged queries hurts overall success rates. If your queries are generated synthetically (templates, LLMs, keyword permutations), track which patterns repeatedly trigger rejections or truncation and reformulate them. See SERP API error catalog for the full error responses.

Get Success Rate Statistics Per Domain

Retrieve SERP API success rate stats from the past 7 days. Supports single domain or wildcard.
Single domain
All monitored TLDs
Once you provide your API key, replace all $API_KEY, $CUSTOMER_ID, $ZONE, and $PASSWORD placeholders accordingly.