Trigger a published Bright Data Scraper Studio collector and download structured JSON in three steps. Copy-paste examples in cURL, Node.js and Python.
This guide sends your first request to the Bright Data Scraper Studio API: trigger a published collector from your own code and get structured JSON back.
No collector yet? A collector is the published scraper you trigger here. Build one in minutes, then come back with its Collector ID (c_...):
Fastest, from your terminal or coding agent:Build a scraper with the Bright Data CLI. Three commands; the AI Agent writes the scraper. Runs as-is inside Claude Code, Cursor or Codex.
Every Bright Data Scraper Studio API call uses bearer-token authentication. Add this header to every request:
Authorization: Bearer YOUR_BRIGHT_DATA_API_TOKEN
A missing or invalid token returns 401 Unauthorized.
2
Trigger your collector
Send the inputs you want the collector to process as a JSON array in the request body. Each object in the array must match the input schema you defined when you built the collector. The default schema is a single url field.
The Bright Data Scraper Studio API responds with a single snapshot ID:
{ "collection_id": "j_abc123def456"}
Keep this ID. You will use it as the snapshot_id in step 3.
queue_next=1 runs your inputs immediately. Omit it (or set 0) to enqueue them behind any in-flight work for the same collector.
3
Poll until ready, then download
The same /dca/dataset endpoint serves both the in-progress and ready responses. Poll it every five seconds until the response is a JSON array.
# Poll every 5 seconds until the response is a JSON array (not an object).while :; do response=$(curl -s \ "https://api.brightdata.com/dca/dataset?id=$SNAPSHOT_ID" \ -H "Authorization: Bearer $BRIGHTDATA_API_KEY") if [[ "${response:0:1}" == "[" ]]; then echo "$response" > results.json break fi sleep 5done
import jsonimport timewhile True: response = requests.get( f"https://api.brightdata.com/dca/dataset?id={snapshot_id}", headers={"Authorization": f"Bearer {API_TOKEN}"}, ) response.raise_for_status() body = response.json() if isinstance(body, list) and body: with open("results.json", "w") as f: json.dump(body, f, indent=2) break time.sleep(5)
The first record usually arrives within a minute, but total time depends on the collector and the target site. Measured against a typical e-commerce product page collector:
For long-running jobs, swap polling for a push delivery destination (webhook, S3, GCS, Azure, SFTP or email) so Bright Data calls you when the snapshot is ready.
Three identifiers appear in Bright Data Scraper Studio. They are easy to confuse because the trigger response uses one name for a value that another endpoint reads under a different name.
Term
Looks like
What it identifies
Collector ID
c_xxxxxxxxxxxxxxxx
The published scraper definition. Stable. You pass it as the collector query parameter on /dca/trigger.
Collection ID (returned as collection_id)
j_xxxxxxxxxxxxxxxx
One run of the collector. The trigger response field is collection_id, but every other endpoint refers to the same value as snapshot_id. They are the same string.
Dataset
a JSON array
The result rows produced by one run. The /dca/dataset endpoint returns this when the run is finished.
Treat collection_id from the trigger response as your snapshot_id everywhere else. They are the same value under two names.
These open-source repositories are exactly the calls above, hardened with environment-variable config, retry/backoff for transient failures, library helpers and a complete README. Fork either and you have a runnable client in 30 seconds.
Node.js starter
Node 18+, ES modules, dotenv, retry/backoff, ~150 LOC
Python starter
Python 3.8+, requests, python-dotenv, retry/backoff, ~150 LOC
Both repositories ship with a CodeSandbox devcontainer so you can fork and run in your browser without any local setup.
Build a Scraper Studio scraper with any of three paths, then use the Collector ID (c_...) it returns here:
Bright Data CLI is the fastest. Run bdata scraper create <url> "<what to extract>" and the AI Agent writes the scraper. The CLI runs as-is inside Claude Code, Cursor or Codex.
AI Agent builds the scraper from a natural-language prompt in the control panel, no code required.
What is the difference between the Collection API and the AI Flow API?
The Collection API (/dca/*, this page) runs an existing collector to get data. The AI Flow API runs the AI Agent to create or self-heal a collector. Most developers integrating Bright Data Scraper Studio into a product use the Collection API.
Can I send different input shapes in the same request?
Yes, as long as every object in the array conforms to the collector’s input schema. If your collector accepts both url and keyword as input fields, you can mix them in one request. Fields you do not include are treated as null.
How do I retry failed inputs of batch job without re-running the successful ones?
Open My Scrapers, select the relevant scraper, and go to the Runs tab. Find the failed batch job, click the three-dot actions menu on the job row, and select Rerun job.Choose Rerun failed pages to retry only the failed pages, or Rerun all from beginning to run all original inputs again.For API workflows, use the Rerun job API with the failed_only option.Only jobs whose data has not expired can be rerun.
Is there a rate limit?
Yes. Per-account concurrency limits apply per collector. See Specifications for current limits. The starter templates linked above already implement exponential backoff for transient 5xx responses.