cURL
curl --request POST \
--url "https://api.brightdata.com/unblocker/req?zone=web_unlocker1" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"url": "https://geo.brdtest.com/welcome.txt"
}'
# => {"response_id":"s4t7w3619285042ra9dke1m8qx"}
# Keep the response_id: you need it to collect the result.import requests
url = "https://api.brightdata.com/unblocker/req"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"url": "https://geo.brdtest.com/welcome.txt",
}
response = requests.post(url, params={"zone": "web_unlocker1"},
headers=headers, json=payload)
response.raise_for_status()
# Keep the response_id: you need it to collect the result.
response_id = response.json()["response_id"]
print(response_id)const response = await fetch(
"https://api.brightdata.com/unblocker/req?zone=web_unlocker1",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://geo.brdtest.com/welcome.txt",
}),
},
);
// Keep the response_id: you need it to collect the result.
const { response_id } = await response.json();
console.log(response_id);package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
payload := []byte(`{"url":"https://geo.brdtest.com/welcome.txt"}`)
req, _ := http.NewRequest("POST",
"https://api.brightdata.com/unblocker/req?zone=web_unlocker1",
bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
// Keep the ResponseID: you need it to collect the result.
var job struct {
ResponseID string `json:"response_id"`
}
json.NewDecoder(res.Body).Decode(&job)
fmt.Println(job.ResponseID)
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/unblocker/req",
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([
'url' => 'https://geo.brdtest.com/welcome.txt',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'country' => 'US',
'webhook_url' => '<string>',
'webhook_method' => '<string>',
'webhook_data' => '<unknown>',
'debug' => true
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/unblocker/req")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://geo.brdtest.com/welcome.txt\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"country\": \"US\",\n \"webhook_url\": \"<string>\",\n \"webhook_method\": \"<string>\",\n \"webhook_data\": \"<unknown>\",\n \"debug\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/unblocker/req")
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 \"url\": \"https://geo.brdtest.com/welcome.txt\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"country\": \"US\",\n \"webhook_url\": \"<string>\",\n \"webhook_method\": \"<string>\",\n \"webhook_data\": \"<unknown>\",\n \"debug\": true\n}"
response = http.request(request)
puts response.read_body{
"response_id": "s4t7w3619285042ra9dke1m8qx"
}Web Unlocker API
Unlocker async request
Use the Bright Data Web Unlocker API (98% success rate) async endpoint. POST /unblocker/req submits an unlock request and returns a response_id as JSON.
POST
/
unblocker
/
req
cURL
curl --request POST \
--url "https://api.brightdata.com/unblocker/req?zone=web_unlocker1" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"url": "https://geo.brdtest.com/welcome.txt"
}'
# => {"response_id":"s4t7w3619285042ra9dke1m8qx"}
# Keep the response_id: you need it to collect the result.import requests
url = "https://api.brightdata.com/unblocker/req"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"url": "https://geo.brdtest.com/welcome.txt",
}
response = requests.post(url, params={"zone": "web_unlocker1"},
headers=headers, json=payload)
response.raise_for_status()
# Keep the response_id: you need it to collect the result.
response_id = response.json()["response_id"]
print(response_id)const response = await fetch(
"https://api.brightdata.com/unblocker/req?zone=web_unlocker1",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://geo.brdtest.com/welcome.txt",
}),
},
);
// Keep the response_id: you need it to collect the result.
const { response_id } = await response.json();
console.log(response_id);package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
payload := []byte(`{"url":"https://geo.brdtest.com/welcome.txt"}`)
req, _ := http.NewRequest("POST",
"https://api.brightdata.com/unblocker/req?zone=web_unlocker1",
bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
// Keep the ResponseID: you need it to collect the result.
var job struct {
ResponseID string `json:"response_id"`
}
json.NewDecoder(res.Body).Decode(&job)
fmt.Println(job.ResponseID)
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/unblocker/req",
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([
'url' => 'https://geo.brdtest.com/welcome.txt',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'country' => 'US',
'webhook_url' => '<string>',
'webhook_method' => '<string>',
'webhook_data' => '<unknown>',
'debug' => true
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/unblocker/req")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://geo.brdtest.com/welcome.txt\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"country\": \"US\",\n \"webhook_url\": \"<string>\",\n \"webhook_method\": \"<string>\",\n \"webhook_data\": \"<unknown>\",\n \"debug\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/unblocker/req")
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 \"url\": \"https://geo.brdtest.com/welcome.txt\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"country\": \"US\",\n \"webhook_url\": \"<string>\",\n \"webhook_method\": \"<string>\",\n \"webhook_data\": \"<unknown>\",\n \"debug\": true\n}"
response = http.request(request)
puts response.read_body{
"response_id": "s4t7w3619285042ra9dke1m8qx"
}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
Body
application/json
Set to true to return the x-brd-debug header. The header is returned by GET /unblocker/get_result when you collect the response, not on this submit call. See Debugging Web Unlocker API.
Example:
true
Was this page helpful?