Skip to main content
POST

How It Works

This synchronous API endpoint allows users to send a scraping request and receive the results in real-time directly in the response, at the point of request - such as a terminal or application - without the need for external storage or manual downloads. This approach streamlines the data collection process by eliminating additional steps for retrieving results. Set the output format with the format query parameter. If no format is provided, the response is NDJSON, one record per line. Set format=json to get a JSON array.

Request body

Send the inputs as an object with an input array:
limit_per_input matters for discovery requests, whose result count is open-ended. This request discovers posts in a subreddit and stops at three:
Send it with type=discover_new&discover_by=subreddit_url on the query string. Put limit_per_input in the body, next to input. A limit_per_input query parameter also caps the results (verified September 30, 2026), but the body is the recommended place. A bare JSON array of input objects is also accepted and returns the same records. It cannot carry limit_per_input or custom_output_fields:
POST /datasets/v3/trigger takes the same object body. On that endpoint the object is also where a deliver block goes. See Asynchronous requests.

Timeout Limit

Please note that this synchronous request is subject to a 1 minute timeout limit. If the data retrieval process exceeds this limit, the API will return an HTTP 202 response, indicating that the request is still being processed. In such cases, you will receive a snapshot ID to monitor and retrieve the results asynchronously via the Monitor Snapshot and Download Snapshot endpoints. The 202 response carries a retry-after header (10 seconds at the time of writing) telling you how long to wait before polling. Example response on timeout:
202

How to handle a 202 response

A /scrape request that runs past 1 minute answers HTTP 202 with a snapshot_id instead of records, and the job continues. Branch on the status code, then poll Monitor progress and fetch the records with Download snapshot. The polling loop is in How to scrape in bulk with async requests.
Python
A 200 carries the records; a 202 carries the snapshot ID. Any other status is an error, listed under Response below. The fix for each error is on Scraper API error codes.

Custom inputs

You can add custom fields to the input schema. Whatever you send in those fields is returned in the results for each record. Use this to:
  • Keep a unified output structure across different scrapers and datasets.
  • Pass an id, row_index or any internal key so you can match results back to your original input rows.

Authorizations

Authorization
string
header
required

Use your Bright Data API Key as a Bearer token in the Authorization header.

How to authenticate:

  1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
  2. Include the API Key in the Authorization header of your requests
  3. Format: Authorization: Bearer YOUR_API_KEY

Example:

Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication

Query Parameters

dataset_id
string
required

Dataset ID for which data collection is triggered.

custom_output_fields
string

List of output columns, separated by | (e.g., url|about.updated_on). Filters the response to include only the specified fields.

Example:

"url|about.updated_on"

include_errors
boolean

Include errors report with the results.

format
enum<string>
default:ndjson

Format of the response: ndjson (default, one record per line), json (a JSON array) or csv. See output formats.

Available options:
ndjson,
json,
csv

Body

application/json
input
object[]
required

Array of input objects. The fields depend on the scraper, for example url or user_name.

custom_output_fields
string

List of output columns, separated by | (e.g., url|about.updated_on). Filters the response to include only the specified fields.

Example:

"url|about.updated_on"

limit_per_input
integer | null

Maximum number of records to return per input, or null. Applies to discovery requests, whose result count is otherwise open-ended.

Required range: x >= 1
Example:

null

Response

OK

A JSON array of records. An empty array means the inputs produced no records; check the input URLs.

The response is of type string.

Example:

"OK"