Google Header 参数
Bright Data SERP API 接受以下参数以控制 Google 搜索响应的格式。解析
| 参数 | 类型 | 是否必填 | 默认值 | 可接受值 |
|---|---|---|---|---|
brd_json | 字符串 | 否 | 无 | 1, html |
x-unblock-data-format | HTTP 标头 | 否 | 无 | parsed_light |
原始 HTML
默认响应格式。无需额外参数。curl --proxy brd.superproxy.io:44445 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> "https://www.google.com/search?q=pizza"
brd_json
| 值 | 响应 |
|---|---|
brd_json=1 | 解析后的 JSON |
brd_json=html | 解析后的 JSON,附带 "html" 字段,包含原始 HTML |
curl --proxy brd.superproxy.io:44445 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> "https://www.google.com/search?q=pizza&brd_json=1"
curl --proxy brd.superproxy.io:44445 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> "https://www.google.com/search?q=pizza&brd_json=html"
x-unblock-data-format: parsed_light
| 值 | 响应 |
|---|---|
parsed_light | 解析后的 JSON,仅限前 10 条自然搜索结果,延迟约比完整 JSON 解析低 50% |
curl -k --proxy brd.superproxy.io:44445 --proxy-user brd-customer-<customer_id>-zone-<zone_name>:<zone_password> -H "x-unblock-data-format: parsed_light" "https://www.google.com/search?q=pizza"
curl -X POST https://api.brightdata.com/request \
--header "Content-Type: application/json" \
--header "Authorization: Bearer API_KEY" \
--data '{
"zone": "serp_api1",
"url": "https://www.google.com/search?q=pizza",
"format": "raw",
"headers": {
"x-unblock-data-format": "light_json"
}
}'
{
"organic": [
{
"link": "https://en.wikipedia.org/wiki/Pizza",
"title": "Pizza",
"description": "an Italian, specifically Neapolitan, dish typically consisting of a flat base of leavened wheat-based dough topped with tomato, cheese, and other ingredients",
"extensions": [
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizzeria",
"text": "Pizzeria"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Neapolitan_pizza",
"text": "Neapolitan pizza"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizza_Margherita",
"text": "Pizza Margherita"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizza_marinara",
"text": "Pizza marinara"
}
],
"global_rank": 1
},
{
"link": "https://www.tripadvisor.com/Restaurants-g293763-c31-Luanda_Luanda_Province.html",
"title": "THE 10 BEST Pizza Places in Luanda (Updated 2025)",
"description": "Pizza il Forno serves delicious pizza, with a thin crust and fresh ingredients...",
"global_rank": 2
},
{
"link": "https://www.foodandwine.com/cooking-techniques/pizza-guide",
"title": "The F&W Guide to Making Pizza at Home",
"description": "A super-flavorful and forgiving pizza dough is the key to pro-level pies.",
"global_rank": 7
},
{
"link": "https://www.pizzahut.com/",
"title": "Pizza Hut | Delivery & Carryout - No One OutPizzas The Hut!",
"description": "Large Hut Lover's Pizzas. $12.99 each. Limited time only.",
"global_rank": 9
},
{
"link": "https://www.bbcgoodfood.com/recipes/pizza-margherita-4-easy-steps",
"title": "Pizza Margherita in 4 easy steps recipe",
"description": "Even a novice cook can master the art of perfect pizza with our step-by-step guide.",
"global_rank": 10
}
],
"videos": [
{
"link": "https://www.youtube.com/watch?v=HLfRhp4EGlo",
"title": "SECRET TO CRISPY PIZZA AT HOME | ONLY PIZZA RECIPE ...",
"global_rank": 3
},
{
"link": "https://www.youtube.com/watch?v=4mA54Uy3YGY",
"title": "Classic New York Pizza At Home",
"global_rank": 4
},
{
"link": "https://www.youtube.com/watch?v=ICHxQHsf7E4",
"title": "Creative Pizza Making (Neapolitan Pizzette)",
"global_rank": 5
}
]
}
x-unblock-data-format: screenshot, html, parsed
| 值 | 响应 |
|---|---|
| 将多种响应格式打包在一起的 Zip 压缩包 |
curl -k --proxy brd.superproxy.io:44445 --proxy-user brd-customer-<customer_id>-zone-<zone_name>:<zone_password> -H "x-unblock-data-format: screenshot,html,parsed" "https://www.google.com/search?q=pizza"
curl -X POST https://api.brightdata.com/request \
--header "Content-Type: application/json" \
--header "Authorization: Bearer API_KEY" \
--data '{
"zone": "serp_api1",
"url": "https://www.google.com/search?q=pizza",
"format": "raw",
"headers": {
"x-unblock-data-format": "light_json"
}
}'
{
"organic": [
{
"link": "https://en.wikipedia.org/wiki/Pizza",
"title": "Pizza",
"description": "an Italian, specifically Neapolitan, dish typically consisting of a flat base of leavened wheat-based dough topped with tomato, cheese, and other ingredients",
"extensions": [
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizzeria",
"text": "Pizzeria"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Neapolitan_pizza",
"text": "Neapolitan pizza"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizza_Margherita",
"text": "Pizza Margherita"
},
{
"type": "site_link",
"link": "https://en.wikipedia.org/wiki/Pizza_marinara",
"text": "Pizza marinara"
}
],
"global_rank": 1
},
{
"link": "https://www.tripadvisor.com/Restaurants-g293763-c31-Luanda_Luanda_Province.html",
"title": "THE 10 BEST Pizza Places in Luanda (Updated 2025)",
"description": "Pizza il Forno serves delicious pizza, with a thin crust and fresh ingredients...",
"global_rank": 2
},
{
"link": "https://www.foodandwine.com/cooking-techniques/pizza-guide",
"title": "The F&W Guide to Making Pizza at Home",
"description": "A super-flavorful and forgiving pizza dough is the key to pro-level pies.",
"global_rank": 7
},
{
"link": "https://www.pizzahut.com/",
"title": "Pizza Hut | Delivery & Carryout - No One OutPizzas The Hut!",
"description": "Large Hut Lover's Pizzas. $12.99 each. Limited time only.",
"global_rank": 9
},
{
"link": "https://www.bbcgoodfood.com/recipes/pizza-margherita-4-easy-steps",
"title": "Pizza Margherita in 4 easy steps recipe",
"description": "Even a novice cook can master the art of perfect pizza with our step-by-step guide.",
"global_rank": 10
}
],
"videos": [
{
"link": "https://www.youtube.com/watch?v=HLfRhp4EGlo",
"title": "SECRET TO CRISPY PIZZA AT HOME | ONLY PIZZA RECIPE ...",
"global_rank": 3
},
{
"link": "https://www.youtube.com/watch?v=4mA54Uy3YGY",
"title": "Classic New York Pizza At Home",
"global_rank": 4
},
{
"link": "https://www.youtube.com/watch?v=ICHxQHsf7E4",
"title": "Creative Pizza Making (Neapolitan Pizzette)",
"global_rank": 5
}
]
}
请求标头
可以将以下标头与 SERP API 请求一起传递,用于控制行为、会话锁定、输出格式等。| 标头 | 可用性 | 用途 |
|---|---|---|
x-brd-expect | 具有 custom_expect 权限的 Zone | 自定义响应内容的成功/失败验证条件 |
x-brd-data-format | 全部 | 控制输出格式:parsed、screenshot、json、extract-network 等 |
x-brd-url-fragment | 全部(浏览器步骤) | 为浏览器渲染请求 URL 追加 URL 片段(#...) |
x-brd-session | 全部 | 设置客户会话 ID,将请求锁定到同一节点/IP |
x-request-priority | 全部 | 请求优先级提示——可能影响内部路由决策 |
x-brd-get-rate-limit | 全部 | 存在时,响应中包含当前速率限制信息标头 |
cookie | 包含 cookie 的 cookie_whitelist 或 header_whitelist 的 Zone | 客户 Cookie 转发至目标站点(按白名单过滤) |
header_whitelist 规则中的任何标头 | 具有 cust_head 权限的 Zone | 自定义标头按原样转发至目标站点 |
示例
使用x-brd-session 将请求锁定到同一 IP:
curl -vk \
-x brd-customer-$CUSTOMER_ID-zone-$ZONE:$PASSWORD@brd.superproxy.io:44445 \
-H 'x-brd-session: my-session-123' \
"https://www.google.com/search?q=bright+data"
x-brd-data-format 控制输出格式:
curl -vk \
-x brd-customer-$CUSTOMER_ID-zone-$ZONE:$PASSWORD@brd.superproxy.io:44445 \
-H 'x-brd-data-format: json' \
"https://www.google.com/search?q=bright+data"
x-brd-expect 等待特定元素 (需要 custom_expect 权限):
curl -vk \
-x brd-customer-$CUSTOMER_ID-zone-$ZONE:$PASSWORD@brd.superproxy.io:44445 \
-H 'x-brd-expect: {"element": "#search"}' \
"https://www.google.com/search?q=bright+data"
x-brd-url-fragment 追加 URL 片段:
curl -vk \
-x brd-customer-$CUSTOMER_ID-zone-$ZONE:$PASSWORD@brd.superproxy.io:44445 \
-H 'x-brd-url-fragment: !/results/section2' \
"https://www.google.com/search?q=bright+data"
x-brd-get-rate-limit 获取速率限制信息:
curl -vk \
-x brd-customer-$CUSTOMER_ID-zone-$ZONE:$PASSWORD@brd.superproxy.io:44445 \
-H 'x-brd-get-rate-limit: true' \
"https://www.google.com/search?q=bright+data"