# Submits a batch of URLs for asynchronous scraping. Returns 202 Accepted with a batch ID immediately.
Results are delivered via webhook callback or polled via GET /v1/scrape/batch/{batchId}.

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/scrape/batch:
    post:
      summary: >-
        Submits a batch of URLs for asynchronous scraping. Returns 202 Accepted
        with a batch ID immediately.

        Results are delivered via webhook callback or polled via GET
        /v1/scrape/batch/{batchId}.
      deprecated: false
      description: >-
        All URLs in the batch share a single browser context for efficiency.
        Each URL is processed

        with VisitUrlAction + GetHtmlAction in sequence. Credits are reserved
        when the batch is accepted.
                    
        Example Request:

        ```json
            POST /v1/scrape/batch?disableJavaScript=true
            {
              "urls": [
                "https://example.com/page1",
                "https://example.com/page2"
              ]
            }
        ```
                    
        Possible error codes:

        - 400 (validation_error): Too many URLs or invalid request body.

        - 401 (unauthorized): The API key is missing or invalid.

        - 402 (payment_required): Insufficient credits for the requested batch.
      tags:
        - Scrape
        - Scrape
      parameters:
        - name: deviceName
          in: query
          description: 'The device to emulate. Example: "Desktop Chrome"'
          required: false
          example: ''
          schema:
            type: string
        - name: locale
          in: query
          description: 'The BCP-47 language tag to set in the browser. Example: "en-US"'
          required: false
          example: ''
          schema:
            type: string
        - name: timezone
          in: query
          description: >-
            The IANA time zone ID to set in the browser. Example:
            "America/New_York"
          required: false
          example: ''
          schema:
            type: string
        - name: disableResourceExclusion
          in: query
          description: >-
            Disables default rules that block tracking and ad resources. Set to
            true to load all page resources.

            Default: false
          required: false
          example: ''
          schema:
            type: boolean
        - name: useAdvancedSpoofing
          in: query
          description: |-
            Enables advanced techniques to avoid bot detection.
            When enabled, it can happen that the device name will be ignored.
            Default: true
          required: false
          example: ''
          schema:
            type: boolean
        - name: disableJavaScript
          in: query
          description: >-
            Disables JavaScript rendering and executes the request using a
            faster, non-interactive mechanism.

            Useful for scraping static content at lower cost.

            Default: false
          required: false
          example: ''
          schema:
            type: boolean
        - name: useResidentialProxy
          in: query
          description: |-
            Enables usage of residential proxies for the request.
            Residential proxies are more reliable but more expensive (5x cost).
            Default: false
          required: false
          example: ''
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchScrapeRequest'
            example:
              urls:
                - https://example.com/page1
                - https://example.com/page2
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchScrapeResponse'
              example:
                batchId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                totalUrls: 3
                estimatedCost: 9
                availableCredits: 500
                statusUrl: /v1/scrape/batch/a1b2c3d4-e5f6-7890-abcd-ef1234567890
          headers: {}
          x-apidog-name: ''
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
              example:
                type: https://httpstatuses.com/400
                title: Too many URLs
                status: 400
                detail: Maximum batch size is 50. Received 60.
                code: too_many_urls
          headers: {}
          x-apidog-name: ''
        '401':
          description: Unauthorized
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ProblemDetails'
          headers: {}
          x-apidog-name: ''
        '402':
          description: Payment Required
          content:
            application/json:
              schema: *ref_0
              example:
                type: https://httpstatuses.com/402
                title: Insufficient credits
                status: 402
                detail: Not enough credits for this batch.
                code: payment_required
          headers: {}
          x-apidog-name: ''
      security:
        - ApiKey: []
          x-apidog:
            schemeGroups:
              - id: Mc0cG4A4XLcGS0YA4VR99
                schemeIds:
                  - ApiKey
            required: true
            use:
              id: Mc0cG4A4XLcGS0YA4VR99
            scopes:
              Mc0cG4A4XLcGS0YA4VR99:
                ApiKey: []
      x-apidog-folder: Scrape
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1110200/apis/api-44734726-run
components:
  schemas:
    BatchScrapeRequest:
      required:
        - urls
      type: object
      properties:
        urls:
          minItems: 1
          type: array
          items:
            type: string
          description: >-
            The list of absolute URLs to scrape. Must contain at least 1 and at
            most MaxBatchSize entries.
      additionalProperties: false
      description: >-
        Request payload for batch scraping multiple URLs in a single request.

        Browser parameters (disableJavaScript, deviceName, etc.) are passed via
        query string,

        consistent with all other scraping endpoints.

        Results are retrieved by polling GET /v1/scrape/batch/{batchId}.
      x-apidog-orders:
        - urls
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    BatchScrapeResponse:
      type: object
      properties:
        batchId:
          type: string
          description: >-
            Unique batch identifier. Use this to poll status or correlate
            webhook callbacks.
          nullable: true
        totalUrls:
          type: integer
          description: The total number of URLs in the batch.
          format: int32
        estimatedCost:
          type: integer
          description: The estimated credit cost of this batch.
          format: int32
        availableCredits:
          type: integer
          description: The user's remaining credit balance after reservation (if known).
          format: int32
        statusUrl:
          type: string
          description: The expected HTTP status URL for polling batch status.
          nullable: true
      additionalProperties: false
      description: >-
        The immediate 202 Accepted response returned when a batch scrape request
        is accepted.
      x-apidog-orders:
        - batchId
        - totalUrls
        - estimatedCost
        - availableCredits
        - statusUrl
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - type
        - title
        - status
        - detail
        - instance
        - errors
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - type
        - title
        - status
        - detail
        - instance
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKey:
      type: apikey
      description: >-
        API Key authentication for programmatic access. Enter your API key in
        the text input below.
      name: apiKey
      in: query
servers:
  - url: https://api.scrapingduck.com
    description: Prod Env
security:
  - ApiKey: []
    x-apidog:
      schemeGroups:
        - id: Mc0cG4A4XLcGS0YA4VR99
          schemeIds:
            - ApiKey
      required: true
      use:
        id: Mc0cG4A4XLcGS0YA4VR99
      scopes:
        Mc0cG4A4XLcGS0YA4VR99:
          ApiKey: []

```
