跳转到主要内容
POST
Rerun a Scraper Studio job
从已有的 Bright Data Scraper Studio 作业启动新的运行。不发送请求体时,将从头重新运行整个作业;发送 failed_only: 1 时,仅重新运行失败的步骤。 请求成功后会启动一个作业并返回其 collection_id。原作业保持不变。
只有数据尚未过期的作业才能重新运行。调用该端点前,请在列出 Scraper Studio 作业IDE 作业数据 API 中查看作业的 expired 时间戳。如果数据已过期,重新运行将失败,您必须使用原始输入触发新作业。Scraper Studio 保留批量采集结果 16 天,保留实时结果 7 天。请参见 Scraper Studio 规格说明

重新运行行为

请求

不发送请求体即可重新运行全部内容:
添加 failed_only: 1 可仅重试失败的步骤:

响应

IDE 作业数据 API接收批量数据中,将返回的 collection_id 用作 job_id。它标识的是新的重新运行作业,而非原作业。

如何查找作业 ID

使用作业列表端点查找您要重新运行的作业 ID:
将返回的 id 值用作 job_id 路径参数。完整参数列表请参见列出 Scraper Studio 作业

何时使用该端点

  • 修复选择器或解析器后,重试批量作业中失败的输入,无需重新采集已成功的输入
  • 按计划重新采集完整作业,以刷新会随时间变化的数据
  • 在目标网站发生故障并导致大量 blockeddetect_block 错误后重新运行
如需在决定完整重新运行还是使用 failed_only 之前,查看哪些输入失败及其原因,请使用获取作业错误

相关

授权

Authorization
string
header
必填

Use your Bright Data API Key as a Bearer token in the Authorization header.

How to authenticate:

  1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
  2. Include the API Key in the Authorization header of your requests
  3. Format: Authorization: Bearer YOUR_API_KEY

Example:

Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication

路径参数

job_id
string
必填

ID of the job to rerun

请求体

application/json

Omit the body to rerun the full job. Send failed_only: 1 to rerun only the failed steps.

failed_only
number

Set to 1 to rerun only the failed steps. Omit to rerun the full job.

示例:

1

响应

Rerun job started

collection_id
string

ID of the new rerun job

start_eta
string<date-time>

Estimated start time of the rerun job