# Install: pip install brightdata-sdk
from brightdata import BrightDataClient
async with BrightDataClient(api_key="YOUR_API_KEY") as client:
# Run and get results in one call (sync)
data = await client.scraper_studio.run(
collector="c_abc123",
input={"url": "https://www.ebay.com/itm/326972541236"},
)
print(data)// Install: npm install @brightdata/sdk
import { bdclient } from '@brightdata/sdk';
const client = new bdclient({ apiKey: 'YOUR_API_KEY' });
// Run and get results in one call (sync)
const results = await client.scraperStudio.run('c_your_collector_id', {
input: { url: 'https://www.ebay.com/itm/326972541236' },
});
console.log(results);
await client.close();curl --request POST \
--url https://api.brightdata.com/dca/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://www.ebay.com/itm/326972541236"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/crawl",
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://www.ebay.com/itm/326972541236'
]),
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/crawl"
payload := strings.NewReader("{\n \"url\": \"https://www.ebay.com/itm/326972541236\"\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/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://www.ebay.com/itm/326972541236\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/crawl")
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://www.ebay.com/itm/326972541236\"\n}"
response = http.request(request)
puts response.read_body[
{
"product_title": "Apple iPad 11th Gen, 128 GB, Wi-Fi + 5G, 11 in - Silver - BRAND NEW SEALED",
"price": {
"value": 324.99,
"currency": "USD",
"symbol": "$"
},
"condition": "New: A brand-new, unused, unopened, undamaged item in its original packaging (where packaging is ...",
"seller_feedback_percentage": "100% positive feedback",
"seller_items_sold": "173 items sold",
"seller_since": "Joined Nov 2012",
"item_specifics": {
"brand": "Apple",
"model": "Apple iPad (11th generation)",
"processor_model": "Apple A16 Bionic",
"operating_system": "iPadOS"
},
"storage_options": [],
"seller_ratings": {
"accurate_description": "--",
"shipping_cost": "--",
"shipping_speed": "--",
"communication": "4.9"
},
"product_images": [
"https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp",
"https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp"
],
"feedback_count": 36,
"financing_options": {
"monthly_payment": {
"value": 13.99,
"currency": "USD",
"symbol": "$"
},
"payment_plan_duration": "(12 monthly payment plan)",
"apr": "13.99%"
},
"input": {
"url": "https://www.ebay.com/itm/326972541236"
},
"seller_namestest": "jwc8109"
}
]{
"error": "crawl_results_timeout",
"message": "Timed out waiting for crawl results (timeout=NaNs). The page crawl is continuing in the background, you can poll a GET request to https://api.brightdata.com/dca/get_result?response_id=ID until the result is ready",
"response_id": "RESPONSE_ID"
}Trigger sync real-time scrape
Trigger a synchronous real-time Scraper Studio scrape. POST /dca/crawl holds the request open until the scraper finishes or times out, then returns JSON.
# Install: pip install brightdata-sdk
from brightdata import BrightDataClient
async with BrightDataClient(api_key="YOUR_API_KEY") as client:
# Run and get results in one call (sync)
data = await client.scraper_studio.run(
collector="c_abc123",
input={"url": "https://www.ebay.com/itm/326972541236"},
)
print(data)// Install: npm install @brightdata/sdk
import { bdclient } from '@brightdata/sdk';
const client = new bdclient({ apiKey: 'YOUR_API_KEY' });
// Run and get results in one call (sync)
const results = await client.scraperStudio.run('c_your_collector_id', {
input: { url: 'https://www.ebay.com/itm/326972541236' },
});
console.log(results);
await client.close();curl --request POST \
--url https://api.brightdata.com/dca/crawl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://www.ebay.com/itm/326972541236"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/crawl",
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://www.ebay.com/itm/326972541236'
]),
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/crawl"
payload := strings.NewReader("{\n \"url\": \"https://www.ebay.com/itm/326972541236\"\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/crawl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://www.ebay.com/itm/326972541236\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/crawl")
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://www.ebay.com/itm/326972541236\"\n}"
response = http.request(request)
puts response.read_body[
{
"product_title": "Apple iPad 11th Gen, 128 GB, Wi-Fi + 5G, 11 in - Silver - BRAND NEW SEALED",
"price": {
"value": 324.99,
"currency": "USD",
"symbol": "$"
},
"condition": "New: A brand-new, unused, unopened, undamaged item in its original packaging (where packaging is ...",
"seller_feedback_percentage": "100% positive feedback",
"seller_items_sold": "173 items sold",
"seller_since": "Joined Nov 2012",
"item_specifics": {
"brand": "Apple",
"model": "Apple iPad (11th generation)",
"processor_model": "Apple A16 Bionic",
"operating_system": "iPadOS"
},
"storage_options": [],
"seller_ratings": {
"accurate_description": "--",
"shipping_cost": "--",
"shipping_speed": "--",
"communication": "4.9"
},
"product_images": [
"https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp",
"https://i.ebayimg.com/images/g/4a8AAeSw7x5pboS0/s-l1600.webp"
],
"feedback_count": 36,
"financing_options": {
"monthly_payment": {
"value": 13.99,
"currency": "USD",
"symbol": "$"
},
"payment_plan_duration": "(12 monthly payment plan)",
"apr": "13.99%"
},
"input": {
"url": "https://www.ebay.com/itm/326972541236"
},
"seller_namestest": "jwc8109"
}
]{
"error": "crawl_results_timeout",
"message": "Timed out waiting for crawl results (timeout=NaNs). The page crawl is continuing in the background, you can poll a GET request to https://api.brightdata.com/dca/get_result?response_id=ID until the result is ready",
"response_id": "RESPONSE_ID"
}timeout is reached, then returns the collected data directly as JSON. This is the difference from the async real-time endpoint, which returns a response_id immediately.
Timeout behavior
Thetimeout query parameter must be between 25s and 50s.
- If the scraper finishes within the timeout, the response returns
200 OKwith the collected data. - If the scraper is still running when the timeout is reached, the response returns
202 Acceptedwith aresponse_id. Use thatresponse_idwith the Realtime Data endpoint to retrieve the result asynchronously.
When to use synchronous real-time
Use synchronous real-time (POST /dca/crawl) when:
- You need the result in the same HTTP request.
- You are sending a single input.
- Your client can keep the request open until the scrape finishes.
- The scrape normally completes within the configured timeout.
POST /dca/trigger_immediate) when:
- You want to trigger the scrape and retrieve the result later.
- You do not want to keep the HTTP request open.
- You need to process multiple inputs in one run.
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 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
Query Parameters
A unique identification of the collector to run
"c_abc123"
How long the request stays open while waiting for the result. Must be between 25s and 50s. If the scraper finishes within the timeout, the response returns 200 OK with the collected data. If the scraper is still running when the timeout is reached, the response returns 202 Accepted with a response_id.
"50s"
Set to dev to trigger the development version of the scraper
Body
A single input object. The fields must match the input schema defined for the collector. A URL-based scraper may require url, while a search scraper may require fields such as keyword and location.
Single input object whose fields match the collector input schema.
Example field for collectors that take a target URL. Replace with the fields your collector expects.
Response
OK
Was this page helpful?