Rerun a Scraper Studio job
curl --request POST \
--url https://api.brightdata.com/dca/jobs/{job_id}/rerun \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"failed_only": 1
}
'import requests
url = "https://api.brightdata.com/dca/jobs/{job_id}/rerun"
payload = { "failed_only": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({failed_only: 1})
};
fetch('https://api.brightdata.com/dca/jobs/{job_id}/rerun', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/jobs/{job_id}/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'failed_only' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/jobs/{job_id}/rerun"
payload := strings.NewReader("{\n \"failed_only\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/dca/jobs/{job_id}/rerun")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"failed_only\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/jobs/{job_id}/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"failed_only\": 1\n}"
response = http.request(request)
puts response.read_body{
"collection_id": "j_mdb7x2kq93nfytra1",
"start_eta": "2026-07-20T12:10:12.301Z"
}管理作业
重新运行 Scraper Studio 作业
使用 POST /dca/jobs//rerun 从已有的 Bright Data Scraper Studio 作业启动新运行。可重新运行全部内容,或发送 failed_only 仅重试失败部分。
POST
/
dca
/
jobs
/
{job_id}
/
rerun
Rerun a Scraper Studio job
curl --request POST \
--url https://api.brightdata.com/dca/jobs/{job_id}/rerun \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"failed_only": 1
}
'import requests
url = "https://api.brightdata.com/dca/jobs/{job_id}/rerun"
payload = { "failed_only": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({failed_only: 1})
};
fetch('https://api.brightdata.com/dca/jobs/{job_id}/rerun', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/jobs/{job_id}/rerun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'failed_only' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/jobs/{job_id}/rerun"
payload := strings.NewReader("{\n \"failed_only\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/dca/jobs/{job_id}/rerun")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"failed_only\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/jobs/{job_id}/rerun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"failed_only\": 1\n}"
response = http.request(request)
puts response.read_body{
"collection_id": "j_mdb7x2kq93nfytra1",
"start_eta": "2026-07-20T12:10:12.301Z"
}从已有的 Bright Data Scraper Studio 作业启动新的运行。不发送请求体时,将从头重新运行整个作业;发送
添加
在 IDE 作业数据 API 和接收批量数据中,将返回的
将返回的
failed_only: 1 时,仅重新运行失败的步骤。
请求成功后会启动一个新作业并返回其 collection_id。原作业保持不变。
只有数据尚未过期的作业才能重新运行。调用该端点前,请在列出 Scraper Studio 作业或 IDE 作业数据 API 中查看作业的
expired 时间戳。如果数据已过期,重新运行将失败,您必须使用原始输入触发新作业。Scraper Studio 保留批量采集结果 16 天,保留实时结果 7 天。请参见 Scraper Studio 规格说明。重新运行行为
| 请求体 | 行为 | 使用场景 |
|---|---|---|
| 无请求体 | 从头重新运行整个作业 | 需要重新采集全部输入 |
{ "failed_only": 1 } | 仅重新运行所选作业中失败的步骤 | 作业已完成但存在失败项,只需重试这些部分 |
请求
不发送请求体即可重新运行全部内容:curl -X POST "https://api.brightdata.com/dca/jobs/$JOB_ID/rerun" \
-H "Authorization: Bearer $BRIGHT_DATA_API_TOKEN"
response = requests.post(
f"https://api.brightdata.com/dca/jobs/{job_id}/rerun",
headers={"Authorization": f"Bearer {API_TOKEN}"},
)
rerun = response.json()
print(rerun["collection_id"])
const response = await fetch(
`https://api.brightdata.com/dca/jobs/${jobId}/rerun`,
{
method: 'POST',
headers: { Authorization: `Bearer ${process.env.BRIGHT_DATA_API_TOKEN}` },
}
);
const rerun = await response.json();
console.log(rerun.collection_id);
failed_only: 1 可仅重试失败的步骤:
curl -X POST "https://api.brightdata.com/dca/jobs/$JOB_ID/rerun" \
-H "Authorization: Bearer $BRIGHT_DATA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"failed_only": 1}'
response = requests.post(
f"https://api.brightdata.com/dca/jobs/{job_id}/rerun",
headers={
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json",
},
json={"failed_only": 1},
)
rerun = response.json()
const response = await fetch(
`https://api.brightdata.com/dca/jobs/${jobId}/rerun`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.BRIGHT_DATA_API_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ failed_only: 1 }),
}
);
const rerun = await response.json();
响应
{
"collection_id": "j_mdb7x2kq93nfytra1",
"start_eta": "2026-07-20T12:10:12.301Z"
}
collection_id 用作 job_id。它标识的是新的重新运行作业,而非原作业。
如何查找作业 ID
使用作业列表端点查找您要重新运行的作业 ID:curl "https://api.brightdata.com/dca/collector/jobs?from_date=2026-06-01&to_date=2026-07-13" \
-H "Authorization: Bearer $BRIGHT_DATA_API_TOKEN"
id 值用作 job_id 路径参数。完整参数列表请参见列出 Scraper Studio 作业。
何时使用该端点
- 修复选择器或解析器后,重试批量作业中失败的输入,无需重新采集已成功的输入
- 按计划重新采集完整作业,以刷新会随时间变化的数据
- 在目标网站发生故障并导致大量
blocked或detect_block错误后重新运行
failed_only 之前,查看哪些输入失败及其原因,请使用获取作业错误。
相关
- 获取作业错误:重新运行前确认哪些输入失败
- IDE 作业数据 API:查看原作业的
expired时间戳和失败数量 - 列出 Scraper Studio 作业:查找传入该端点的
job_id - 取消 Scraper Studio 作业:停止误启动的重新运行
授权
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
路径参数
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.
Set to 1 to rerun only the failed steps. Omit to rerun the full job.
示例:
1
此页面对您有帮助吗?