Skip to main content
POST
The Filter endpoint of the Bright Data Marketplace Dataset API runs a large or file-based filter job against any of 900+ Marketplace datasets datasets and returns a snapshot_id you can download once the job completes.
Paste your API key into the authorization field. To get an API key, create an account and learn how to generate an API key.

When should I use Filter?

Use Filter for bulk or file-driven jobs where asynchronous processing is acceptable:
  • Filter a Marketplace dataset by field values, such as country, price or a boolean flag.
  • Find records whose text fields contain a value.
  • Match records against a list of exact values.
  • Filter against large value lists from CSV or JSON files, such as excluding 100k+ company IDs.
  • Bulk exports of more than 1,000 records.
  • Datasets not yet supported by Search.
For sub-second real-time lookups on supported datasets, use Search instead.

How does Filter work?

  • A call to the Filter endpoint starts an async job and creates a snapshot of the filtered data in your account.
  • The endpoint returns a snapshot_id, not the filtered records.
  • The maximum job time is 5 minutes. Jobs that run longer are cancelled.
  • Charges apply per record in the snapshot, at the standard Marketplace rate of $2.5 CPM.
  • Filter works on all 900+ Marketplace datasets.
  • Filter groups support a maximum nesting depth of 3 levels.

How do I authenticate?

Filter uses Bearer token authentication. Pass your API key in the Authorization header:
Get your key from account settings.

What are the Filter limits?

For complex filtering needs beyond these limits, contact your account manager.

How do I filter with a JSON request?

Use JSON mode when the filter values fit directly in the request. Send dataset_id, records_limit and filter in the JSON body and set Content-Type to application/json:
Filter returns a snapshot_id:

Which request fields does Filter accept?

How do I filter by field type?

Each field filter combines a field name, an operator and a value. The examples below show common operators by field type. For the full operator table, filter groups and nesting rules, see the filter syntax reference.

Text fields

Use includes to match records where the field contains the value:
This filter matches values such as John Smith, Johnson and Senior John Account Manager. Use not_includes to exclude them.

Lists of exact values

Use in to match records where the field value is exactly one of the values in a list:
Use not_in to exclude records whose field value is in the list.

When should I use includes instead of in?

For example, includes with engineer matches Sales Engineer and Engineering Manager, while in with ["Sales Engineer"] matches only Sales Engineer.

Boolean fields

Use = with true or false:

Number fields

Number fields support =, !=, <, <=, >, >=, in, not_in, is_null and is_not_null:

Date ranges

Combine >= and <= in an and group to match a date range:

Array fields

Use array_includes to match records where a multi-value field contains an exact value:
This filter matches records where the categories array contains Electronics. Use not_array_includes to exclude them.

Empty fields

Use is_not_null to keep only records where the field has a value, or is_null for records where the field is empty. These operators take no value:

How do I filter with CSV or JSON file uploads?

Use file uploads when you need to filter against a large list of values. Send the request as multipart/form-data, pass dataset_id and records_limit as query parameters, and set each filter’s value to the name of an uploaded file:
The response is the same snapshot_id object that JSON mode returns.

How do I format the CSV or JSON file?

  • The first line must be a header that matches the field name in your filter.
  • Each following line contains a single value.
  • The file must contain one column only.
  • Empty rows and rows that contain only spaces are not supported.
Example: industries.csv
Values in the file must match the dataset field format exactly.

Which operators accept a file reference?

File references work only with in, not_in, includes, not_includes, array_includes and not_array_includes. For what each operator does with a file, see the filter syntax reference.

How do I filter against more than 10,000 values?

Split the values into files of up to 10,000 rows each and attach them all in a single request. This example excludes company IDs listed across three files:
Files can also feed different fields in one request. This example combines an industries file and a regions file:

How do I fix file upload errors?

What does Filter return?

Filter returns a snapshot_id, the ID of the filtered snapshot the request created:
Use the snapshot_id with the snapshot endpoints once the job completes:

How much does Filter cost?

Filter costs $2.5 CPM (per 1,000 records returned), the same rate as the Marketplace. There is no charge when the filter returns 0 records.

What errors can Filter return?

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

ID of the dataset to filter (required in multipart/form-data mode)

Example:

"gd_l1viktl72bvl7bjuj0"

records_limit
integer

Limit the number of records to be included in the snapshot

Example:

1000

Body

dataset_id
string
required

ID of the dataset to filter

Example:

"gd_l1viktl72bvl7bjuj0"

filter
Single field filter · object
required
Example:
records_limit
integer

Limit the number of records to be included in the snapshot

Example:

1000

Response

Job of creating the snapshot successfully started

snapshot_id
string

ID of the snapshot