Scrape URLs into structured records in one call
brightdata.web.scrape.structuredScrape one or more URLs into structured records and get them back in the same call
- 价格
- $0.0015/result按供应商原价
- 成功率
- 84.4%近 30 天 · 38 次
- 延迟 p50
- 60 秒p95 61 秒
- 最后验证
- 2026年7月28日实测可用
POSThttps://toolswitch.dev/v1/tools/brightdata.web.scrape.structured?format=json&dataset_id=gd_l1vikfch901nx3by4预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
the API reference documents the body as {input: [...]}, while the quickstarts post a bare array [{url: …}] to the same path — both appear in official docs, so treat the array as the payload and the wrapper as optional until verified. HARD 1-minute timeout: past that the call returns HTTP 202 with a snapshot_id and you must collect the rows from brightdata.web.scrape.job.results instead. Use trigger/progress/snapshot for anything beyond a few URLs
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
format | 字符串 | 可选 | json (default) | ndjson | csv | json |
dataset_id | 字符串 | 必填 | which managed scraper to run — it decides both the site and the output columns. List them with brightdata.account.datasets.list | gd_l1vikfch901nx3by4 |
include_errors | 布尔 | 可选 | adds a per-input error report to the output | |
custom_output_fields | 字符串 | 可选 | pipe-separated field list to trim the response | url|about.updated_on |
- 查询参数
format字符串可选json (default) | ndjson | csv
示例:
jsondataset_id字符串必填which managed scraper to run — it decides both the site and the output columns. List them with brightdata.account.datasets.list
示例:
gd_l1vikfch901nx3by4include_errors布尔可选adds a per-input error report to the output
custom_output_fields字符串可选pipe-separated field list to trim the response
示例:
url|about.updated_on
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X POST 'https://toolswitch.dev/v1/tools/brightdata.web.scrape.structured?format=json&dataset_id=gd_l1vikfch901nx3by4' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
-H "Content-Type: application/json" \
--data-raw '[{"url":"https://www.instagram.com/instagram"}]'import os
import json
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/brightdata.web.scrape.structured?format=json&dataset_id=gd_l1vikfch901nx3by4",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
json=json.loads("[{\"url\":\"https://www.instagram.com/instagram\"}]"),
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/brightdata.web.scrape.structured?format=json&dataset_id=gd_l1vikfch901nx3by4", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
"Content-Type": "application/json",
},
body: JSON.stringify(JSON.parse("[{\"url\":\"https://www.instagram.com/instagram\"}]")),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.0015/result 计费,已含服务费。