Prerequisites
- A Bright Data account with an active API key
- Completed the Quickstart
请求结构
每个同步请求都遵循相同的模式:POST https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7aof0k82r803d5bjm&format=json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
[{"url": "https://chatgpt.com/", "prompt": "Your search prompt here"}]
url 字段始终为 https://chatgpt.com/。prompt 字段包含您的搜索查询。
/scrape 端点专为实时的单 URL 请求设计。它最多支持 20 个 输入,最多等待 1 分钟。如果采集耗时更长,响应为 HTTP 202,返回 snapshot_id 而不是数据,采集将继续以异步方式进行。请通过异步请求获取结果,或使用 Webhook 投递接收结果。ChatGPT 搜索
Dataset ID:gd_m7aof0k82r803d5bjm
基本搜索
发送提示并获取带有引用的结构化答案:curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7aof0k82r803d5bjm&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://chatgpt.com/", "prompt": "Top hotels in New York"}]'
200 响应。处理时间取决于目标网站状况和爬虫负载。
Example response
Example response
[
{
"url": "https://chatgpt.com/?q=Top%20hotels%20in%20New%20York",
"prompt": "Top hotels in New York",
"answer_text": "Map data is currently unavailable Aman New York 4.3 Отель 2 450 $ The Plaza Hotel The Carlyle, A Rosewood Hotel 4.5 Отель 1 359 $ The Mark Hotel 4.5 Отель 2...",
"answer_text_markdown": "* Map data is currently unavailable 4.4 インド料理店 ¥1,000~2,000 神戸鉄板焼 白秋 4.7 ステーキハウス ¥10,000 以...",
"model": null,
"web_search_triggered": false,
"is_map": true,
"citations": [],
"prompt_sent_at": "2026-09-06T10:23:10.445Z",
"answer_html": "<html lang=\"en-US\" dir=\"ltr\" data-theme=\"light\" data-contrast=\"default\" data-build=\"prod-4ec31e730ff961987ab0f9a7e9dd6248f66da3b0\" data-close-image-viewer=\"C...",
"country": "JP"
}
]
后续提示搜索
使用additional_prompt 字段在同一会话中提出后续问题:
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7aof0k82r803d5bjm&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://chatgpt.com/", "prompt": "Top hotels in New York", "additional_prompt": "Which of these are pet-friendly?"}]'
Example response
Example response
[
{
"url": "https://chatgpt.com/?q=Top%20hotels%20in%20New%20York",
"prompt": "Top hotels in New York",
"answer_text": "Map data is currently unavailable The St. Regis New York 4.5 Hotel $2,201 Park Hyatt New York 4.6 Hotel $3,191 The Carlyle, A Rosewood Hotel 4.5 Hotel $1,359...",
"additional_answer_text": "Map data is currently unavailable Park Hyatt New York 4.6 Hotel The Manner 4.6 Resort hotel Refinery Hotel 4.5 Hotel Made Hotel 4.4 Hotel New York Hilton Mid...",
"model": null,
"web_search_triggered": true,
"citations": [
{
"url": "https://www.cntraveler.com/gallery/best-hotels-in-new-york-city?utm_source=chatgpt.com",
"title": "35 Best Hotels in New York City We Won't Shut Up About | Condé Nast Traveler",
"description": "Condé Nast Traveler",
"icon": null
}
],
"prompt_sent_at": "2026-09-06T10:23:07.451Z",
"answer_html": "<html lang=\"en-US\" dir=\"ltr\" data-theme=\"light\" data-contrast=\"default\" data-build=\"prod-4ec31e730ff961987ab0f9a7e9dd6248f66da3b0\" data-close-image-viewer=\"C...",
"is_map": true
}
]
快速参考:数据集 ID
| Endpoint | Dataset ID | Input |
|---|---|---|
| ChatGPT Search | gd_m7aof0k82r803d5bjm | url + prompt |
输入字段
| Field | Required | Description |
|---|---|---|
url | Yes | 始终为 https://chatgpt.com/ |
prompt | Yes | 搜索提示(最多 4,096 个字符) |
country | No | 国家代码,用于位置定向结果 |
index | No | 唯一追踪 ID(数字) |
require_sources | No | 如果未找到来源则返回错误(布尔值) |
additional_prompt | No | 同一会话中的后续提示 |
web_search | No | 启用或禁用网络搜索(默认值:true) |
输出格式
使用format 查询参数控制响应格式:
| Value | Description |
|---|---|
json | JSON 数组(默认) |
ndjson | 换行分隔的 JSON,每行一条记录 |
csv | 逗号分隔值 |
相关内容
异步批处理请求
在单个批处理作业中使用数百个提示搜索 ChatGPT。
API 参考
完整的参数和响应字段参考。