Skip to main content
POST
Scrape data and return it directly in the response.

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. You can specify the desired output format using the format parameter. If no format is provided, the response will default to JSON.

Request body

POST /datasets/v3/scrape accepts the inputs in either of two shapes. Both return the same records. A bare JSON array of input objects. Every quickstart and platform page uses this form:
An object with an input array. Use this form when you also pass custom_output_fields to return only the fields you name, or limit_per_input to cap how many records each input returns:
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. The Control Panel’s generated cURL uses this same body shape. limit_per_input is ignored when passed as a query parameter on /scrape. POST /datasets/v3/trigger accepts the same two shapes. The object form is also where a deliver block goes on that endpoint. 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.

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:json

Specifies the format of the response (default: ndjson).

Available options:
ndjson,
json,
csv

Body

application/json
{key}
any

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"