Get errors for a Media Data API job
curl --request GET \
--url https://api.brightdata.com/dca/jobs/{job_id}/hp_errors \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/dca/jobs/{job_id}/hp_errors"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/dca/jobs/{job_id}/hp_errors', 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}/hp_errors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/jobs/{job_id}/hp_errors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/dca/jobs/{job_id}/hp_errors")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/jobs/{job_id}/hp_errors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"errors": [
{
"url": "www.youtube.com/watch?v=GBaFv4O5H7g",
"error": "aborted",
"consumer": "dca-hp-so-szakh"
},
{
"url": "www.youtube.com/watch?v=dVSRDWxlWBg",
"error": "aborted",
"consumer": "dca-hp-so-sz5zu"
},
{
"url": "www.youtube.com/watch?v=1YrOL8ZqR4Q",
"error": "aborted",
"consumer": "dca-hp-so-sz6ga"
}
]
}Invalid job ID suppliedJob not foundInternal server errorMedia Data API
Get Media Data API job errors
GET /dca/jobs//hp_errors returns the URL and error reason for every failed input in a Bright Data Media Data API job started with /dca/trigger_hp.
GET
/
dca
/
jobs
/
{job_id}
/
hp_errors
Get errors for a Media Data API job
curl --request GET \
--url https://api.brightdata.com/dca/jobs/{job_id}/hp_errors \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/dca/jobs/{job_id}/hp_errors"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/dca/jobs/{job_id}/hp_errors', 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}/hp_errors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/jobs/{job_id}/hp_errors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/dca/jobs/{job_id}/hp_errors")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/jobs/{job_id}/hp_errors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"errors": [
{
"url": "www.youtube.com/watch?v=GBaFv4O5H7g",
"error": "aborted",
"consumer": "dca-hp-so-szakh"
},
{
"url": "www.youtube.com/watch?v=dVSRDWxlWBg",
"error": "aborted",
"consumer": "dca-hp-so-sz5zu"
},
{
"url": "www.youtube.com/watch?v=1YrOL8ZqR4Q",
"error": "aborted",
"consumer": "dca-hp-so-sz6ga"
}
]
}Invalid job ID suppliedJob not foundInternal server errorRetrieve the error report for a Bright Data Media Data API job. The report lists every input URL that failed and the reason it failed.
The response is an
The
job_id is the hp_ prefixed ID returned by the Media Data API trigger endpoint (POST /dca/trigger_hp). In trigger_hp and hp_errors, HP stands for high payload. Scraper Studio jobs use a different endpoint for job errors.Request
Pass the job ID in the path and your API key in theAuthorization header:
curl "https://api.brightdata.com/dca/jobs/$JOB_ID/hp_errors" \
-H "Authorization: Bearer $BRIGHTDATA_API_KEY"
import os
import requests
job_id = os.environ["JOB_ID"]
response = requests.get(
f"https://api.brightdata.com/dca/jobs/{job_id}/hp_errors",
headers={"Authorization": f"Bearer {os.environ['BRIGHTDATA_API_KEY']}"},
)
errors = response.json()
const jobId = process.env.JOB_ID;
const response = await fetch(
`https://api.brightdata.com/dca/jobs/${jobId}/hp_errors`,
{ headers: { Authorization: `Bearer ${process.env.BRIGHTDATA_API_KEY}` } }
);
const errors = await response.json();
errors array. Each item holds the failed url, the error reason and an internal consumer identifier.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
skip_normalize | boolean | No | When true, returns full non-normalized error details. Default returns normalized errors. |
Errors
| Status | Cause | Fix |
|---|---|---|
400 Bad Request | Invalid job ID format | Verify the job ID matches the hp_ prefixed ID returned by POST /dca/trigger_hp |
404 Not Found | Job does not exist or your account does not have access | Confirm the job ID is current and from a job you triggered |
500 | Internal server error | Retry with exponential backoff, for example 1s, 2s, 4s |
When to use this endpoint
- Resubmit only the failed URLs from a previous Media Data API job
- Show the failure reason for each URL in a UI or admin console
Related
- Media Data API: the trigger endpoint that creates the job and returns the
job_id
Authorizations
Your Bright Data API key. Find it in the Bright Data Control Panel.
Path Parameters
Job ID returned from the /dca/trigger_hp endpoint
Example:
"hp_mn1l61rn1p94ynijur"
Query Parameters
Return full (non-normalized) error details
Response
List of errors for the specified job
Show child attributes
Show child attributes
Was this page helpful?