跳转到主要内容
使用 Crawl API 有两种方式:
  1. 基于 API 的数据采集
  2. 无代码采集(通过控制面板)

基于 API 的数据采集

  1. 通过简单的 HTTP POST 触发一次数据采集 任务
  2. 指定 URL 和输出格式
  3. 接收一个 snapshot_id,用于稍后获取结果
Code Example
curl -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" -d '[{"url":"https://example.com"},{"url":"https://example.com/1"}]' "https://api.brightdata.com/datasets/v3/trigger?dataset_id=<dataset_id>&include_errors=<true/false>&custom_output_fields=<custom_output_fields>"

查询参数:

dataset_id
query
required
您的数据集 ID(例如:gd_m6gjtfmeh43we6cqc
include_errors
query
default:"true"
在结果中包含错误日志
custom_output_fields
query
markdown, html, ld_json 等。 \选择适合您工作流的格式:
# Main Article Title

This is the introduction paragraph with **bold text** and *italics*.

## Subheading

* List item one
* List item two

> This is a blockquote from the articlesh Code Example

[Link text](https://example.com/more-info)
![Image description](https://example.com/image.jpg)

数据投递

可将结果投递至:
  • Webhooks
  • 外部存储(S3、GCS 等)
  • 通过 API 或控制面板直接下载

无代码爬虫(控制面板)

使用控制面板即可启动爬取任务,无需编写任何代码。 步骤:
  1. 打开 Crawl API 控制面板
  2. 输入目标域名或 URL
  3. 选择输出格式
  4. 启动爬取
  5. 从仪表盘直接下载结果