# Executes a list of browser actions.

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/browser/actions/execute:
    post:
      summary: Executes a list of browser actions.
      deprecated: false
      description: >-
        This endpoint allows for the execution of a sequence of actions in a
        specified browser environment.
                    
        Default Behavior:

        - A realistic, rotating browser fingerprint will be used.

        - The browser's locale and timezone will be matched to the proxy's IP
        address geolocation.
                    
        Overrides:

        - Providing a `deviceName` uses that specific device profile.

        - Providing a `locale` or `timezone` will disable the automatic matching
        based on the proxy.
                    
        Invariants:

        - The `actions` list must contain at least 1 and no more than 50 items.

        - Actions are executed sequentially.

        - Any URL provided in an action must be an absolute URL using the http
        or https scheme.
                    
        Example Request:

        ```json

        {
          "actions": [
            { "type": "VisitUrlAction", "url": "https://example.com" },
            { "type": "GetHtmlAction" }
          ]
        }

        ```
                    
        Possible error codes:

        - 400 (validation_error): The request body is invalid. This can happen
        if the `actions` array is missing, empty, or if the JSON is malformed.

        - 400 (too_many_actions): The number of actions in the `actions` array
        exceeds the server limit of 50.

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

        - 404 (device_not_found): The specified `deviceName` does not exist. A
        list of available devices can be retrieved from the `/devices` endpoint.

        - 400 (unsupported_action): The `type` of an action in the `actions`
        array is not a recognized action.

        - 400 (invalid_url_scheme): An action contains a URL that is not a valid
        HTTP or HTTPS URL.

        - 500 (unhandled_error): An unexpected server-side error occurred during
        the execution of the request.
      tags:
        - Browser
        - Browser
      parameters:
        - name: deviceName
          in: query
          description: 'The device to emulate. Example: "Desktop Chrome"'
          required: false
          schema:
            type: string
        - name: locale
          in: query
          description: 'The BCP-47 language tag to set in the browser. Example: "en-US"'
          required: false
          schema:
            type: string
        - name: timezone
          in: query
          description: >-
            The IANA time zone ID to set in the browser. Example:
            "America/New_York"
          required: false
          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
          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
          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
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicBrowserAutomationRequest'
            example:
              actions:
                - type: VisitUrlAction
                  url: https://news.ycombinator.com
                - type: VisitRandomLinkAction
                  viewTime: 5
                  stayOnDomain: true
                  goBack: true
                - type: GetHtmlAction
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BrowserActionResultActionExecutionResponse
              example:
                executionId: myApiKey_a1b2c3d4
                results:
                  - type: VisitUrlActionResult
                    success: true
                    data:
                      status: 200
                  - type: GetHtmlActionResult
                    success: true
                    data:
                      html: <!doctype html><html>...</html>
                meta:
                  actionsRequested: 2
                  actionsSucceeded: 2
                  startedAtUtc: '2025-01-01T12:00:00Z'
                  finishedAtUtc: '2025-01-01T12:00:02Z'
                  durationMs: 2000
                  responseSizeBytes: 1234
                  maxActionsAllowed: 50
          headers: {}
          x-apidog-name: ''
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
              example:
                type: https://httpstatuses.com/400
                title: Invalid request body
                status: 400
                detail: At least one action is required.
                code: validation_error
          headers: {}
          x-apidog-name: ''
        '401':
          description: Unauthorized
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ProblemDetails'
          headers: {}
          x-apidog-name: ''
        '404':
          description: Not Found
          content:
            application/json:
              schema: *ref_0
              example:
                type: https://httpstatuses.com/404
                title: Device not found
                status: 404
                detail: Device 'NonExistent' not found.
                code: device_not_found
          headers: {}
          x-apidog-name: ''
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: *ref_0
              example:
                type: https://httpstatuses.com/500
                title: Unhandled server error
                status: 500
                detail: An unexpected error occurred.
                code: unhandled_error
          headers: {}
          x-apidog-name: ''
      security:
        - ApiKey: []
          x-apidog:
            schemeGroups:
              - id: 2jqiMrf9V3Y4sSUc6Mk1_
                schemeIds:
                  - ApiKey
            required: true
            use:
              id: 2jqiMrf9V3Y4sSUc6Mk1_
            scopes:
              2jqiMrf9V3Y4sSUc6Mk1_:
                undefined: []
      x-apidog-folder: Browser
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1110200/apis/api-26531022-run
components:
  schemas:
    PublicBrowserAutomationRequest:
      required:
        - actions
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/BrowserAction'
          description: |-
            Ordered list of actions for the browser to perform.
            Actions will be executed sequentially from the first to the last.
      additionalProperties: false
      description: >-
        Request payload for launching a browser session. This is the
        public-facing version without ViewSettings.
      x-apidog-orders:
        - actions
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    BrowserAction:
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        data:
          type: string
          nullable: true
      additionalProperties: false
      x-apidog-orders:
        - name
        - description
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    BrowserActionResultActionExecutionResponse:
      type: object
      properties:
        executionId:
          type: string
          description: Unique execution id (also echoed in X-Execution-Id header).
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/BrowserActionResult'
          description: List of individual action results in the order executed.
          nullable: true
        meta:
          $ref: '#/components/schemas/ActionExecutionMeta'
      additionalProperties: false
      description: >-
        Envelope returned by action execution endpoints providing results and
        metadata.
      x-apidog-orders:
        - executionId
        - results
        - meta
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ActionExecutionMeta:
      type: object
      properties:
        actionsRequested:
          type: integer
          description: Total number of actions requested in this execution.
          format: int32
        actionsSucceeded:
          type: integer
          description: Total number of actions that reported success.
          format: int32
        startedAtUtc:
          type: string
          description: UTC timestamp (ISO 8601) when execution started.
          format: date-time
        finishedAtUtc:
          type: string
          description: UTC timestamp (ISO 8601) when execution finished.
          format: date-time
        durationMs:
          type: integer
          description: Total execution duration in milliseconds.
          format: int64
          readOnly: true
        responseSizeBytes:
          type: integer
          description: >-
            Size in bytes of the serialized results payload (not including
            envelope overhead).
          format: int64
        maxActionsAllowed:
          type: integer
          description: >-
            The maximum number of actions allowed for a single request at the
            time of execution.
          format: int32
      additionalProperties: false
      description: Metadata describing an execution batch.
      x-apidog-orders:
        - actionsRequested
        - actionsSucceeded
        - startedAtUtc
        - finishedAtUtc
        - durationMs
        - responseSizeBytes
        - maxActionsAllowed
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    BrowserActionResult:
      type: object
      properties:
        action:
          type: string
          nullable: true
        success:
          type: boolean
        message:
          type: string
          nullable: true
        timestamp:
          type: string
          format: date-time
        duration:
          type: string
          format: date-span
        data:
          type: array
          items:
            $ref: '#/components/schemas/ResultData'
          nullable: true
      additionalProperties: false
      x-apidog-orders:
        - action
        - success
        - message
        - timestamp
        - duration
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ResultData:
      type: object
      properties:
        name:
          type: string
          nullable: true
        data:
          type: 'null'
      additionalProperties: false
      x-apidog-orders:
        - name
        - data
      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: 2jqiMrf9V3Y4sSUc6Mk1_
          schemeIds:
            - ApiKey
      required: true
      use:
        id: 2jqiMrf9V3Y4sSUc6Mk1_
      scopes:
        2jqiMrf9V3Y4sSUc6Mk1_:
          undefined: []

```
