Skip to main content

Parsing and response format configuration

You can control and override the default API response format setup defined during API creation in Bright Data control panel. We allow either override by URL parameter brd_json or by relaying a header x-unblock-data-format

Get response as raw HTML

Add header parameter: x-unblock-data-format: html. Example:

Get response as Full JSON

Add header parameter: x-unblock-data-format: jsonor add URL parameter: brd_json=1. Examples:
Header parameter
URL Parameter

Get Full JSON with a structure holding the full HTML as string

Add URL parameter: brd_json=html or header parameter: x-unblock-data-format: html Example:
JSON+HTML

Get light JSON

Add header parameter: x-unblock-data-format: parsed_light or URL parameter brd_json=parsed_light to get a faster response (works twice as fast as Full SERP) with fewer components. Full schema documentation can be seen here: https://docs.brightdata.com/products/serp-api/parsed-json-results#google-response-schema-light-json Examples:
Header parameter
URL parameter

Get response as screenshot

Add header parameter: x-unblock-data-format: screenshot . Response will be a binary PNG image. In the example below add --output flag to curl to capture response to image file. Example:

Automatic search query optimization

Bright Data can automatically optimize eligible Google Search queries before sending them to Google. These adjustments are designed to improve request success while preserving the original search intent. This optional feature is supported by both SERP API and Fast SERP. Because optimization behavior may evolve, some queries may be adjusted while others are sent unchanged.

Native proxy

Enable automatic query optimization by adding the x-unblock-search-rewrite: on request header:

API request

When using the Bright Data API, add "search_rewrite": true to the JSON request body:

Parsed response fields

When automatic query optimization is enabled, use these fields to understand which query produced the response:
If your application needs the original query exactly as submitted, retain it in your application. In parsed responses, general.query contains the effective query sent to Google.
For information about comparing general.query and general.detected_query, see How to detect query truncation.

Get element rectangle information BETA

Add URL parameter brd_rects=1 in order to get results rectangle area as displayed on search result screen. This allows you to know when, in relation to viewport (which signifies screen resolution used to render the page) how much space does the result take on the visible screen.viewport (screen size) can be found in general element. Notes:
  1. Getting rectangle data will increase response time. Expect response time to range between 5 seconds to 60 seconds per request.
  2. In BETA version you must also relaybrd_json=1 URL parameter in addition to brd_rects=1 .
Response elements which have rectangle information:
  • organic
  • videos
  • images
  • people_also_ask
  • ai_overview
  • related_searches
  • perspectives
  • forums
  • pagination
  • latest_posts
Example:

How to configure routing

Pin requests to the same IP with x-brd-session. This feature will attempt to keep the same proxy IP address which was used previously.

Page Load configuration

Wait for a specific element with x-brd-expect (requires custom_expect permission). Use this option in order to prevent premature response, and wait till specific element is rendered by google.

URL Control configuration

Append a URL fragment with x-brd-url-fragment: Use this option if you need to maintain a base URL address, and append a suffix by your logic.

Get current rate limit

Get rate limit info with x-brd-get-rate-limit: Get current target website rate limit, response is

Request Headers: Summary

The following headers can be passed with your SERP API requests to control behavior, session pinning, output format, and more.