> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger async batch collection

> Use the Bright Data Scraper Studio API to trigger async batch collection. POST /dca/trigger starts a custom collector job; returns 200 OK with JSON results.



## OpenAPI

````yaml api-reference/web-scraper-ide-rest-api POST /dca/trigger
openapi: 3.1.0
info:
  title: Brightdata API
  description: API for interaction with datasets marketplace
  version: 1.0.0
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /dca/trigger:
    post:
      description: Trigger a scraper for batch collection method
      parameters:
        - name: collector
          in: query
          required: true
          schema:
            type: string
          description: A unique identification of scraper
        - name: version
          in: query
          schema:
            type: string
          description: Set to `dev` to trigger the development version of the scraper
        - name: name
          in: query
          schema:
            type: string
          description: '`human_name` - A human readable name for the batch'
        - name: queue_next
          in: query
          schema:
            type: integer
            default: 1
          description: >-
            If there's already something in the crawl queue, push this job into
            the queue
        - name: queue
          in: query
          schema:
            type: string
          description: >-
            Send another batch of requests that will start after the last one is
            finished
        - name: confirm_cancel
          in: query
          schema:
            type: integer
            default: 1
          description: >-
            Cancel running job and run instead, submit the request and cancel
            running one
        - name: no_downloads
          in: query
          schema:
            type: integer
            default: 1
          description: Disable media file download
        - name: deadline
          in: query
          schema:
            type: string
          description: >-
            Set job time deadline, job will be terminated after specified time.
            `h` for hours, `m` for minutes, `s` for seconds.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
            examples:
              request:
                value:
                  - url: https://targetwebsite.com/product_id/
      responses:
        '200':
          description: OK
          content:
            application/json:
              examples:
                response:
                  value:
                    collection_id: ID_DATASET
                    start_eta: '2021-11-07T13:26:22.702Z'
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.brightdata.com/dca/trigger?collector=c_abc123' \
              --header "Authorization: Bearer YOUR_API_KEY" \
              --header "Content-Type: application/json" \
              --data '[{"url": "https://example.com/product/1"}]'
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://api.brightdata.com/dca/trigger?collector=c_abc123"
            headers = {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json",
            }
            payload = [
                {
                    "url": "https://example.com/product/1"
                }
            ]

            response = requests.post(url, headers=headers, json=payload)
            print(response.text)
        - lang: py
          label: Python SDK
          source: |-
            # Install: pip install brightdata-sdk
            from brightdata import BrightDataClient

            async with BrightDataClient(api_key="YOUR_API_KEY") as client:
                # Trigger an async job, then wait for results
                job = await client.scraper_studio.trigger(
                    "c_abc123", {"url": "https://example.com/product/1"}
                )
                data = await job.wait_and_fetch(timeout=120)
                print(data)
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await
            fetch("https://api.brightdata.com/dca/trigger?collector=c_abc123", {
              method: "POST",
              headers: {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json",
              },
              body: JSON.stringify([
                {
                    "url": "https://example.com/product/1"
                }
            ]),

            });


            const data = await response.text();

            console.log(data);
        - lang: js
          label: JavaScript SDK
          source: >-
            // Install: npm install @brightdata/sdk

            import { bdclient } from '@brightdata/sdk';


            const client = new bdclient({ apiKey: 'YOUR_API_KEY' });


            // Trigger an async job, then wait for results

            const job = await
            client.scraperStudio.trigger('c_your_collector_id', {
              url: 'https://example.com/product/1',
            });

            const data = await job.waitAndFetch();


            console.log(data);


            await client.close();
        - lang: php
          label: PHP
          source: >-
            <?php

            $ch =
            curl_init("https://api.brightdata.com/dca/trigger?collector=c_abc123");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: Bearer YOUR_API_KEY",
                "Content-Type: application/json",
            ]);

            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
                {
                    "url": "https://example.com/product/1"
                }
            ]));


            $response = curl_exec($ch);

            curl_close($ch);

            echo $response;
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tpayload := []byte(\"[{\\\"url\\\": \\\"https://example.com/product/1\\\"}]\")\n\treq, _ := http.NewRequest(\"POST\", \"https://api.brightdata.com/dca/trigger?collector=c_abc123\", bytes.NewBuffer(payload))\n\treq.Header.Set(\"Authorization\", \"Bearer YOUR_API_KEY\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil { panic(err) }\n\tdefer res.Body.Close()\n\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    String body = "[{\"url\": \"https://example.com/product/1\"}]";
                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.brightdata.com/dca/trigger?collector=c_abc123"))
                        .header("Authorization", "Bearer YOUR_API_KEY")
                        .header("Content-Type", "application/json")
                        .method("POST", HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = HttpClient.newHttpClient()
                        .send(request, HttpResponse.BodyHandlers.ofString());
                    System.out.println(response.body());
                }
            }
        - lang: ruby
          label: Ruby
          source: >-
            require 'net/http'

            require 'json'

            require 'uri'


            uri =
            URI.parse("https://api.brightdata.com/dca/trigger?collector=c_abc123")

            request = Net::HTTP::Post.new(uri)

            request["Authorization"] = "Bearer YOUR_API_KEY"

            request["Content-Type"] = "application/json"

            request.body = [{"url": "https://example.com/product/1"}].to_json


            response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) {
            |http| http.request(request) }

            puts response.body
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        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:**

        ```

        Authorization: Bearer
        b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df

        ```


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

````