跳转到主要内容
POST
/
request
cURL
curl --request POST \
  --url https://api.brightdata.com/request \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "zone": "web_unlocker1",
  "url": "https://example.com/page",
  "format": "json",
  "method": "GET",
  "country": "us",
  "data_format": "markdown"
}
'
"成功"
相关指南:Unlocker API Introduction

Bright Data Python SDK

要快速开始使用我们的工具,请查看我们的新 Python SDK。

Authorizations

Authorization
string
header
required

在 Authorization 头中使用您的 Bright Data API Key 作为 Bearer token。

获取 API Key:https://brightdata.com/cp/setting/users

示例: Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df

Query Parameters

async
boolean

设置为 true 以进行异步请求

Body

application/json
zone
string
required

定义您的 Bright Data 产品配置的区域标识符。每个区域包含目标规则、输出偏好和访问权限。 管理区域:https://brightdata.com/cp/zones

Example:

"web_unlocker1"

url
string
required

要抓取的完整目标 URL,必须包含协议 (http/https) 并可公开访问。

Example:

"https://example.com/page"

format
enum<string>
required

响应格式:raw 返回 HTML 内容字符串,json 返回结构化数据。

可用选项:
raw,
json
Example:

"json"

method
string
default:GET

通过代理请求 HTML 的方法为 GET

Example:

"GET"

country
string

代理所在国家的两字母 ISO 3166-1 代码(例如 us, gb, de, ca, au)。如果未指定,系统会根据区域配置自动选择最佳位置。 国家代码列表:https://docs.brightdata.com/cn/general/faqs#where-can-i-see-the-list-of-country-codes

Example:

"us"

data_format
enum<string>

额外响应格式转换:markdown 将 HTML 内容转换为干净的 markdown 格式,screenshot 捕获渲染页面的 PNG 图片。

可用选项:
markdown,
screenshot
Example:

"markdown"

Response

成功

The response is of type string.

Example:

"成功"