前置条件
- 一个Bright Data 账户,拥有有效的 API 密钥
- 已完成快速开始
请求结构
每个同步请求都遵循相同的模式:POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
[{"url": "https://www.amazon.com/..."}]
dataset_id 和输入 URL 格式。
同步请求最多支持 20 个 URL,超时时间为 1 分钟。如果请求花费的时间更长,API 会自动返回
snapshot_id。请参阅异步请求。产品
数据集 ID:gd_l7q7dkf244hwjntr0
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l7q7dkf244hwjntr0&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.amazon.com/dp/B0FQFB8FMG"}]'
200 响应。这需要 10-30 秒。
示例响应
示例响应
[
{
"title": "Apple AirPods Pro 3 Wireless Earbuds with Active Noise Cancellation",
"asin": "B0FQFB8FMG",
"brand": "Apple",
"initial_price": 249,
"final_price": 199.99,
"currency": "USD",
"rating": 4.4,
"reviews_count": 14302,
"seller_name": "Amazon.com",
"availability": "In Stock",
"image_url": "https://m.media-amazon.com/images/I/61solmQSSlL._AC_SL1500_.jpg",
"url": "https://www.amazon.com/dp/B0FQFB8FMG"
}
]
评价
数据集 ID:gd_le8e811kzy4ggddlq
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_le8e811kzy4ggddlq&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.amazon.com/dp/B0FQFB8FMG"}]'
示例响应
示例响应
[
{
"title": "Best noise cancellation ever",
"text": "These earbuds have incredible noise cancellation. The fit is comfortable and battery life is outstanding.",
"rating": 5,
"date": "2024-08-15T00:00:00.000Z",
"author_name": "TechReviewer42",
"verified_purchase": true,
"helpful_count": 234,
"asin": "B0FQFB8FMG",
"url": "https://www.amazon.com/dp/B0FQFB8FMG"
}
]
卖家信息
数据集 ID:gd_lhotzucw1etoe5iw1k
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lhotzucw1etoe5iw1k&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.amazon.com/sp?seller=A2FE5N3LOEXQRU"}]'
示例响应
示例响应
[
{
"seller_name": "TechGadgets Direct",
"seller_id": "A2FE5N3LOEXQRU",
"rating": 4.5,
"ratings_count": 12450,
"positive_feedback_pct": 95,
"business_name": "TechGadgets LLC",
"business_address": "123 Commerce St, Seattle, WA 98101",
"url": "https://www.amazon.com/sp?seller=A2FE5N3LOEXQRU"
}
]
全球产品
数据集 ID:gd_lwhideng15g8jg63s7
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lwhideng15g8jg63s7&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.amazon.co.uk/dp/B0FQFB8FMG"}]'
示例响应
示例响应
[
{
"title": "Apple AirPods Pro 3 Wireless Earbuds with Active Noise Cancellation",
"asin": "B0FQFB8FMG",
"final_price": 229.00,
"currency": "GBP",
"rating": 4.7,
"reviews_count": 32150,
"seller_name": "Amazon.co.uk",
"brand": "Apple",
"availability": "In Stock",
"domain": "amazon.co.uk",
"url": "https://www.amazon.co.uk/dp/B0FQFB8FMG"
}
]
产品搜索
数据集 ID:gd_lwdb4vjm1ehb499uxs
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lwdb4vjm1ehb499uxs&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"keyword": "wireless earbuds", "url": "https://www.amazon.com", "pages_to_search": 1}]'
示例响应
示例响应
[
{
"title": "Apple AirPods Pro 3 Wireless Earbuds with Active Noise Cancellation",
"asin": "B0FQFB8FMG",
"final_price": 199.99,
"currency": "USD",
"rating": 4.7,
"reviews_count": 14302,
"sponsored": false,
"position": 1,
"keyword": "wireless earbuds",
"url": "https://www.amazon.com/dp/B0FQFB8FMG"
},
{
"title": "Samsung Galaxy Buds2 Pro",
"asin": "B0B2SH4CN6",
"final_price": 159.99,
"currency": "USD",
"rating": 4.5,
"reviews_count": 42300,
"sponsored": false,
"position": 2,
"keyword": "wireless earbuds",
"url": "https://www.amazon.com/dp/B0B2SH4CN6"
}
]
快速参考:数据集 ID
| 端点 | 数据集 ID | 输入格式 |
|---|---|---|
| 产品 | gd_l7q7dkf244hwjntr0 | amazon.com/dp/{ASIN} |
| 评价 | gd_le8e811kzy4ggddlq | amazon.com/dp/{ASIN} |
| 卖家信息 | gd_lhotzucw1etoe5iw1k | amazon.com/sp?seller={SELLER_ID} |
| 全球产品 | gd_lwhideng15g8jg63s7 | amazon.{domain}/dp/{ASIN} |
| 产品搜索 | gd_lwdb4vjm1ehb499uxs | keyword + url + pages_to_search |
输出格式
使用format 查询参数控制响应格式:
| 值 | 描述 |
|---|---|
json | JSON 数组(默认) |
ndjson | 换行分隔的 JSON,每行一条记录 |
csv | 逗号分隔值 |
相关内容
异步批量请求
在单个批处理作业中抓取数百个 URL。
API 参考
完整的参数和响应字段参考。