Skip to main content
POST
相关指南:SERP API 简介

Bright Data Python SDK

为了轻松开始使用我们的工具,请查看我们新的 Python SDK。

授权

Authorization
string
header
必填

Use your Bright Data API Key as a Bearer token in the Authorization header.

How to authenticate:

  1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
  2. Include the API Key in the Authorization header of your requests
  3. Format: Authorization: Bearer YOUR_API_KEY

Example:

Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication

查询参数

async
boolean

Set this to true for asynchronous

请求体

application/json
zone
string
必填

Zone identifier that defines your Bright Data product configuration. Each zone contains targeting rules, output preferences, and access permissions. Manage zones at: https://brightdata.com/cp/zones

示例:

"serp_api1"

url
string
必填

Complete target URL to scrape. Must include protocol (http/https), be publicly accessible.

示例:

"https://www.google.com/search?q=pizza"

format
enum<string>
必填

Response format: raw returns HTML content as string, json returns structured data.

可用选项:
raw,
json
示例:

"json"

method
string
默认值:GET

Method for requesting an HTML via proxy is GET.

示例:

"GET"

country
string

Two-letter ISO 3166-1 country code for proxy location (e.g., us, gb, de, ca, au). If not specified, system auto-selects optimal location based on your zone configuration. List of country codes: https://docs.brightdata.com/general/faqs#where-can-i-see-the-list-of-country-codes

示例:

"us"

data_format
enum<string>

Additional response format transformation: markdown converts HTML content to clean markdown format, screenshot captures a PNG image of the rendered page.

可用选项:
markdown,
screenshot
示例:

"markdown"

响应

OK

The response is of type object.