{
  "openapi": "3.1.0",
  "info": {
    "title": "Bright Data Scrapers",
    "description": "API for automated web data collection and extraction with support for various scraping scenarios and delivery options",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.brightdata.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/datasets/v3/trigger": {
      "post": {
        "description": "Trigger a web scraping collection based on provided inputs",
        "parameters": [
          {
            "name": "dataset_id",
            "description": "Dataset ID for which data collection is triggered. Read more about [Dataset ID](/api-reference/terminology#dataset-id).",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "gd_l1vikfnt1wgvvqz95w"
            }
          },
          {
            "name": "custom_output_fields",
            "description": "The \"custom_output_fields\" parameter is used to filter the response data to include only the specified fields. You can list the output columns you want, separated by a pipe (`|`). \n\n For example, if you want the response to include only the URL and the date it was last updated, you would set the parameter to \"url|about.updated_on\". This allows you to customize the data output to include only the fields relevant to your needs.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "url|about.updated_on"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["discover_new"]
            },
            "description": "Set it to \"discover_new\" to trigger a collection that includes a discovery phase. \n\n Enables a discovery phase that finds new entities or products using methods like search, categories, or keywords. Use this when collecting data where specific targets aren't known in advance. It will discover new information based on your provided inputs rather than working with predefined data points."
          },
          {
            "name": "discover_by",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Specifies the method used for discovering new data during a collection. Here are some available options: \n\n - `keyword`: Uses keywords to discover new entities or products. Example: \"smartphones\" - This will trigger a collection to discover new smartphone products or entities. \n - `best_sellers_url`: Uses a URL that lists best-selling items to discover new products.\n Example: \"https://example.com/best-sellers\" - This URL will be used to discover products listed as best sellers on the site. \n - `category_url`: Uses a URL that lists categories to discover new entities within those categories. Example: \"https://example.com/electronics\" - This URL will be used to discover new products within the electronics category. \n - `location`: Uses a location-based approach to discover entities relevant to that location. Example: \"New York\" - This will trigger a collection to discover data related to the specified location."
          },
          {
            "name": "include_errors",
            "in": "query",
            "schema": {
              "type": "boolean",
              "example": true
            },
            "description": "Include errors report with the results. By setting \"include_errors\" to `true`, you will receive a detailed report of any errors that occur during the data collection."
          },
          {
            "name": "limit_per_input",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 1
            },
            "description": "Limit the number of results per input. Sending `limit_per_input` in the request body, next to `input`, is recommended. The query parameter also caps results on `/scrape` and `/trigger` (verified September 30, 2026)."
          },
          {
            "name": "limit_multiple_results",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 1
            },
            "description": "Limit the total number of results"
          },
          {
            "name": "notify",
            "in": "query",
            "schema": {
              "type": "boolean",
              "example": true
            },
            "description": "Specify whether notifications should be sent upon completion of the data collection job. When set to `true`, it enables notifications to be sent to the specified webhook, informing you about the status or completion of the collection."
          },
          {
            "name": "endpoint",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "https://example.com/webhook"
            },
            "description": "Specify the Webhook URL that should be called for the data collection process."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["json", "ndjson", "jsonl", "csv"],
              "example": "json"
            },
            "description": "Format of the delivered data: `json`, `ndjson`, `jsonl` or `csv`. To download the snapshot instead, set `format` on the download request; without it the download is NDJSON. For a Parquet file, deliver to storage with `deliver.filename.extension` set to `parquet`. See [output formats](/products/scrapers/scrapers-library/data-delivery#which-output-formats-can-i-use)."
          },
          {
            "name": "auth_header",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Authorization header for webhook delivery"
          },
          {
            "name": "uncompressed_webhook",
            "in": "query",
            "schema": {
              "type": "boolean",
              "example": true
            },
            "description": "By default, the data will be sent compressed. Pass true to send it uncompressed"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Send an object with an `input` array. A bare array of input objects is also accepted. You can also upload the inputs as a CSV file.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerInput"
              },
              "example": {
                "input": [
                  {
                    "user_name": "zoobarcelona"
                  }
                ],
                "limit_per_input": null
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "string",
                    "format": "binary",
                    "description": "A CSV file containing the URLs or other inputs required by the scraper"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collection job successfully started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "snapshot_id": {
                      "type": "string",
                      "description": "A Snapshot ID is a unique identifier for a specific data snapshot, used to retrieve results from a data collection job triggered via the API. Read more about [Snapshot ID](/api-reference/terminology#snapshot-id).",
                      "example": "sd_m4x7enmven8djfqak"
                    }
                  }
                },
                "example": {
                  "snapshot_id": "sd_m4x7enmven8djfqak"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input parameters\n\nMessages:\n- `{\"error\": \"Invalid input provided\", \"code\": \"validation_error\", \"errors\": [[FIELD, REASON]]}`: An input field failed validation; `errors` names the field and the reason, for example `[\"url\", \"This field must be a valid url\"]`. Fix the input value and resend\n- `{\"error\": \"Parser cannot parse input: ...\", \"code\": \"parse_error\"}`: The request body is not valid JSON. Fix the JSON and resend\n- Invalid attachments\n- This dataset is not allowed for API\n- This dataset is not ready yet\n- No data to trigger\n- Should be at least `LIMIT` inputs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error body"
                },
                "example": {
                  "error": "Invalid input provided",
                  "code": "validation_error",
                  "type": "validation",
                  "line": "{\"url\":\"not-a-url\",\"asin\":\"\",\"zipcode\":\"\",\"language\":\"\"}",
                  "index": 1,
                  "errors": [
                    [
                      "url",
                      "This field must be a valid url"
                    ]
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Messages (plain text):\n- `Credentials are missing`: No `Authorization` header was sent\n- `Auth method is not supported`: The `Authorization` header is not in a supported format\n- `Invalid credentials`: The API key is wrong\n\nSend `Authorization: Bearer YOUR_API_KEY` with a valid API key",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Invalid credentials"
              }
            }
          },
          "404": {
            "description": "Messages (plain text):\n- `Collector not found`: The request has no `dataset_id` query parameter\n- `dataset does not exist`: No scraper matches the `dataset_id`",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "dataset does not exist"
              }
            }
          },
          "429": {
            "description": "Messages:\n- You have too many running jobs for this dataset. Please wait until some of them finish or consider combining multiple inputs into a single request. Running jobs: `RUNNING_JOBS>=JOBS_LIMIT`\n\nA 429 means you exceeded the concurrent job limit, and 25 or more 429s within 5 minutes blacklists the IP. The recovery steps, the backoff rule and a code example are in [Getting a 429 Too Many Requests error?](/products/scrapers/scrapers-library/async-requests#getting-a-429-too-many-requests-error) on the async guide."
          },
          "500": {
            "description": "Messages:\n- Internal server error"
          }
        }
      }
    },
    "/datasets/v3/snapshot/{snapshot_id}": {
      "get": {
        "description": "Download the snapshot content",
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "sd_m4x7enmven8djfqak",
              "description": "The ID that was returned when the collection was triggered"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Format of the data to be received",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["json", "ndjson", "jsonl", "csv"]
            },
            "example": "json"
          },
          {
            "name": "compress",
            "in": "query",
            "description": "Whether the result should be compressed or not",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "batch_size",
            "in": "query",
            "description": "Divide into batches of X records",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1000
            },
            "example": 1000
          },
          {
            "name": "part",
            "in": "query",
            "description": "If batch_size was provided, specify which part to download",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Data in the desired format",
                  "$ref": "#/components/schemas/DatasetSnapshotContent"
                }
              }
            }
          }
        }
      }
    },
    "/datasets/v3/progress/{snapshot_id}": {
      "get": {
        "description": "The Monitor Progress API is designed to track the current status of a data collection job, also known as a snapshot, indicating whether it is collecting data, processing it, or ready for download.",
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "sd_m4x7enmven8djfqak",
              "description": "The ID that was returned when the collection was triggered"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "snapshot_id": {
                      "type": "string"
                    },
                    "dataset_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the snapshot",
                      "enum": ["running", "ready", "failed"]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TriggerInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/TriggerRequest",
            "title": "Object with input"
          },
          {
            "$ref": "#/components/schemas/TriggerInputArray",
            "title": "Bare array (also accepted)"
          }
        ],
        "example": {
          "input": [
            {
              "user_name": "zoobarcelona"
            }
          ],
          "limit_per_input": null
        }
      },
      "DatasetSnapshotContent": {
        "type": "object",
        "example": {
          "url": "https://example.com/product/123",
          "title": "Sample Product",
          "price": "99.99",
          "description": "Product description"
        }
      },
      "TriggerInputArray": {
        "type": "array",
        "description": "A bare JSON array of input objects. Also accepted; it cannot carry `limit_per_input`.",
        "example": [
          {
            "url": "https://www.airbnb.com/rooms/50122531"
          },
          {
            "url": "https://www.airbnb.com/rooms/50127677"
          }
        ],
        "items": {
          "type": "object",
          "additionalProperties": {
            "description": "Properties vary based on the dataset requirements. Most commonly includes 'url' field. \n Example: ```[{\"url\":\"https://www.airbnb.com/rooms/50122531\"},{\"url\":\"https://www.airbnb.com/rooms/50127677\"}]```"
          }
        }
      },
      "TriggerRequest": {
        "type": "object",
        "description": "An `input` array plus optional fields such as `limit_per_input`.",
        "required": [
          "input"
        ],
        "properties": {
          "input": {
            "$ref": "#/components/schemas/TriggerInputArray",
            "description": "Array of input objects. The fields depend on the scraper, for example `url` or `user_name`."
          },
          "limit_per_input": {
            "type": ["integer", "null"],
            "minimum": 1,
            "description": "Maximum number of records to return per input, or `null`. Applies to discovery requests, whose result count is otherwise open-ended.",
            "example": null
          },
          "custom_output_fields": {
            "type": "string",
            "description": "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"
          }
        },
        "example": {
          "input": [
            {
              "user_name": "zoobarcelona"
            }
          ],
          "limit_per_input": null
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use your Bright Data API Key as a Bearer token in the Authorization header.\n\n**How to authenticate:**\n1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users\n2. Include the API Key in the Authorization header of your requests\n3. Format: `Authorization: Bearer YOUR_API_KEY`\n\n**Example:**\n```\nAuthorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df\n```\n\nLearn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication",
        "bearerFormat": "API Key"
      }
    }
  }
}
