cURL
# Wait ~20s before the first poll, 10s before the second, then 5s.
# HTTP 202 means the job is still running; 200 returns the result.
curl --request GET \
--url "https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID" \
--header "Authorization: Bearer YOUR_API_KEY"import time
import requests
url = "https://api.brightdata.com/unblocker/get_result"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"response_id": "YOUR_RESPONSE_ID"}
# Wait ~20s before the first poll, 10s before the second, then 5s.
for delay in [20, 10] + [5] * 20:
time.sleep(delay)
response = requests.get(url, params=params, headers=headers)
if response.status_code == 202:
continue # still processing
response.raise_for_status()
print(response.json())
break
else:
raise TimeoutError("Result was not ready in time")const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
// Wait ~20s before the first poll, 10s before the second, then 5s.
const delays = [20_000, 10_000, ...Array(20).fill(5_000)];
for (const delay of delays) {
await sleep(delay);
const response = await fetch(
"https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } },
);
if (response.status === 202) continue; // still processing
console.log(await response.json());
break;
}package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
url := "https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID"
// Wait ~20s before the first poll, 10s before the second, then 5s.
delays := append([]time.Duration{20 * time.Second, 10 * time.Second},
make([]time.Duration, 20)...)
for i := 2; i < len(delays); i++ {
delays[i] = 5 * time.Second
}
for _, d := range delays {
time.Sleep(d)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
if res.StatusCode == http.StatusAccepted { // still processing
res.Body.Close()
continue
}
body, _ := io.ReadAll(res.Body)
res.Body.Close()
fmt.Println(string(body))
return
}
panic("result was not ready in time")
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/unblocker/get_result",
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;
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/unblocker/get_result")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/unblocker/get_result")
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{
"status_code": 200,
"headers": {
"access-control-allow-origin": "*",
"cache-control": "no-store",
"content-type": "text/plain; charset=utf-8",
"date": "Sun, 18 May 2025 20:01:18 GMT",
"server": "nginx",
"connection": "close",
"transfer-encoding": "chunked"
},
"body": "\nWelcome to Bright Data! Here are your proxy details\nCountry: US\nLatitude: 37.751\nLongitude: -97.822\nTimezone: America/Chicago\nASN number: 20473\nASN Organization name: AS-VULTR\nIP version: IPv4\n\nCommon usage examples:\n\n[USERNAME]-country-us:[PASSWORD] // US based Proxy\n[USERNAME]-country-us-state-ny:[PASSWORD] // US proxy from NY\n[USERNAME]-asn-56386:[PASSWORD] // proxy from ASN 56386\n[USERNAME]-ip-1.1.1.1.1:[PASSWORD] // proxy from dedicated pool\n\nTo get a simple JSON response, use https://geo.brdtest.com/mygeo.json .\n\nMore examples on https://docs.brightdata.com/api-reference/introduction\n\n"
}"Request is pending""Invalid token""Result not found"Web Unlocker API
Unlocker async response
Use the Bright Data Web Unlocker API (98% success rate) async endpoint. GET /unblocker/get_result retrieves the result of a queued unlock request as JSON.
GET
/
unblocker
/
get_result
cURL
# Wait ~20s before the first poll, 10s before the second, then 5s.
# HTTP 202 means the job is still running; 200 returns the result.
curl --request GET \
--url "https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID" \
--header "Authorization: Bearer YOUR_API_KEY"import time
import requests
url = "https://api.brightdata.com/unblocker/get_result"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"response_id": "YOUR_RESPONSE_ID"}
# Wait ~20s before the first poll, 10s before the second, then 5s.
for delay in [20, 10] + [5] * 20:
time.sleep(delay)
response = requests.get(url, params=params, headers=headers)
if response.status_code == 202:
continue # still processing
response.raise_for_status()
print(response.json())
break
else:
raise TimeoutError("Result was not ready in time")const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
// Wait ~20s before the first poll, 10s before the second, then 5s.
const delays = [20_000, 10_000, ...Array(20).fill(5_000)];
for (const delay of delays) {
await sleep(delay);
const response = await fetch(
"https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } },
);
if (response.status === 202) continue; // still processing
console.log(await response.json());
break;
}package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
url := "https://api.brightdata.com/unblocker/get_result?response_id=YOUR_RESPONSE_ID"
// Wait ~20s before the first poll, 10s before the second, then 5s.
delays := append([]time.Duration{20 * time.Second, 10 * time.Second},
make([]time.Duration, 20)...)
for i := 2; i < len(delays); i++ {
delays[i] = 5 * time.Second
}
for _, d := range delays {
time.Sleep(d)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
if res.StatusCode == http.StatusAccepted { // still processing
res.Body.Close()
continue
}
body, _ := io.ReadAll(res.Body)
res.Body.Close()
fmt.Println(string(body))
return
}
panic("result was not ready in time")
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/unblocker/get_result",
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;
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/unblocker/get_result")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/unblocker/get_result")
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{
"status_code": 200,
"headers": {
"access-control-allow-origin": "*",
"cache-control": "no-store",
"content-type": "text/plain; charset=utf-8",
"date": "Sun, 18 May 2025 20:01:18 GMT",
"server": "nginx",
"connection": "close",
"transfer-encoding": "chunked"
},
"body": "\nWelcome to Bright Data! Here are your proxy details\nCountry: US\nLatitude: 37.751\nLongitude: -97.822\nTimezone: America/Chicago\nASN number: 20473\nASN Organization name: AS-VULTR\nIP version: IPv4\n\nCommon usage examples:\n\n[USERNAME]-country-us:[PASSWORD] // US based Proxy\n[USERNAME]-country-us-state-ny:[PASSWORD] // US proxy from NY\n[USERNAME]-asn-56386:[PASSWORD] // proxy from ASN 56386\n[USERNAME]-ip-1.1.1.1.1:[PASSWORD] // proxy from dedicated pool\n\nTo get a simple JSON response, use https://geo.brdtest.com/mygeo.json .\n\nMore examples on https://docs.brightdata.com/api-reference/introduction\n\n"
}"Request is pending""Invalid token""Result not found"Authorizations
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
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd...
Query Parameters
Defines the job id. Received in the response headers of your initial async request.
Response
OK
Was this page helpful?