> ## 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.

# Get browser session

> Use the Bright Data Browser API to get a Browser Session. GET /browser_sessions/{session_id} returns 200 OK with session metadata as JSON.



## OpenAPI

````yaml GET /browser_sessions/{session_id}
openapi: 3.1.0
info:
  title: Browser Sessions API
  description: ''
  version: 1.0.0
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /browser_sessions/{session_id}:
    get:
      summary: Get single browser session
      description: Retrieve details of a specific browser session using its session_id.
      operationId: getBrowserSession
      parameters:
        - name: session_id
          in: path
          required: true
          description: >-
            Unique session identifier. 


            > To retrieve the `session_id` of your current browser session, use
            [`Browser.getSessionId`](https://docs.brightdata.com/products/scraping-browser/cdp-functions/custom#getting-session-id)
            CDP command.
          schema:
            type: string
      responses:
        '200':
          description: Session retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleSessionResponse'
              examples:
                Finished:
                  summary: Finished Session
                  value:
                    session:
                      session_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
                      api_name: scraping_browser1
                      status: finished
                      timestamp: '2025-12-16T18:53:41Z'
                      target_url: https://www.example.com
                      end_url: https://www.example.com/example/sub/domain
                      navigations: 4
                      duration: 209.444
                      captcha: solved
                      bandwidth: 9685211
                      bandwidth_breakdown:
                        total: 9685211
                        payload_bytes: 9667573
                        overhead_bytes: 17638
                        session_bytes: 9570546
                        client_hidden_bytes: 14201
                        before_session: 0
                        session_breakdown:
                          document: 414520
                          script: 3106026
                          stylesheet: 150000
                          image: 5600000
                          font: 300000
                          media: 0
                          other: 0
                        before_session_breakdown:
                          document: 0
                          script: 0
                          stylesheet: 0
                          image: 0
                          font: 0
                          media: 0
                          other: 0
                      error: null
                Failed:
                  summary: Failed Session
                  value:
                    session:
                      session_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
                      api_name: scraping_browser1
                      status: failed
                      timestamp: '2025-12-16T18:53:41Z'
                      target_url: https://www.example.com
                      end_url: https://www.example.com/example/sub
                      navigations: 3
                      duration: 209.444
                      captcha: none
                      bandwidth: 1520431
                      bandwidth_breakdown:
                        total: 1520431
                        payload_bytes: 1498210
                        overhead_bytes: 22221
                        session_bytes: 1301877
                        client_hidden_bytes: 9120
                        before_session: 182000
                        session_breakdown:
                          document: 210450
                          script: 640312
                          stylesheet: 98115
                          image: 301200
                          font: 41800
                          media: 0
                          other: 10000
                        before_session_breakdown:
                          document: 52000
                          script: 90000
                          stylesheet: 15000
                          image: 25000
                          font: 0
                          media: 0
                          other: 0
                      error:
                        code: unknown
                        message: Error
                Running:
                  summary: Running Session
                  value:
                    session:
                      session_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
                      api_name: scraping_browser1
                      status: running
                      timestamp: '2025-12-16T18:53:41Z'
                      target_url: null
                      end_url: null
                      navigations: 0
                      duration: null
                      captcha: none
                      bandwidth: 0
                      bandwidth_breakdown:
                        total: 0
                        payload_bytes: 0
                        overhead_bytes: 0
                        session_bytes: 0
                        client_hidden_bytes: 0
                        before_session: 0
                        session_breakdown:
                          document: 0
                          script: 0
                          stylesheet: 0
                          image: 0
                          font: 0
                          media: 0
                          other: 0
                        before_session_breakdown:
                          document: 0
                          script: 0
                          stylesheet: 0
                          image: 0
                          font: 0
                          media: 0
                          other: 0
                      error: null
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Invalid Format:
                  summary: Invalid session_id format
                  value:
                    error: Invalid session_id format
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Missing Credentials:
                  summary: Missing Credentials
                  value:
                    error: Credentials are missing
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionNotFound'
              examples:
                '':
                  summary: ''
                  value:
                    error: Session not found
                    session_id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
components:
  schemas:
    SingleSessionResponse:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/Session'
    ErrorMessage:
      type: object
      properties:
        error:
          type: string
    SessionNotFound:
      type: object
      properties:
        error:
          type: string
        session_id:
          type: string
    Session:
      type: object
      properties:
        session_id:
          type: string
          description: Unique session identifier
        api_name:
          type: string
          description: Name of the Browser API used
        status:
          type: string
          enum:
            - running
            - finished
            - failed
          description: 'Session status. Values: `running`, `finished`, `failed`'
        target_url:
          type: string
          nullable: true
          description: Target url from initial navigation
        end_url:
          type: string
          nullable: true
          description: The last url before the session closed
        navigations:
          type: integer
          description: Number of page navigations performed
        timestamp:
          type: string
          format: date-time
          description: Session start time in ISO 8601 format
        duration:
          type: number
          nullable: true
          description: Total session duration in seconds
        captcha:
          type: string
          enum:
            - solved
            - none
            - failed
            - detected
          description: 'Captcha status. Values: `solved`, `none`, `failed`, `detected`'
        bandwidth:
          type: integer
          description: >-
            Total billable bandwidth in bytes. Always equal to
            `bandwidth_breakdown.total`.
        bandwidth_breakdown:
          $ref: '#/components/schemas/BandwidthBreakdown'
        error:
          description: null for running sessions or finished session with no error
          oneOf:
            - $ref: '#/components/schemas/ErrorObject'
            - type: 'null'
    BandwidthBreakdown:
      type: object
      description: >-
        What the session's bandwidth was spent on, in bytes. Only `total` is
        billed.
      properties:
        total:
          type: integer
          description: >-
            Billed bytes. All encrypted bytes sent and received over the proxy
            tunnel for the session.
        payload_bytes:
          type: integer
          description: >-
            Part of `total`. The encrypted content of requests and responses
            (TLS application data), compressed as it travels on the network.
        overhead_bytes:
          type: integer
          description: >-
            Part of `total`. TLS handshakes, the header on every encrypted
            record, and other protocol messages.
        session_bytes:
          type: integer
          description: >-
            Traffic during your session as counted from Chrome's CDP `Network.*`
            events.
        client_hidden_bytes:
          type: integer
          description: >-
            Bytes received during your session for requests that never produced
            the CDP events your script listens to. Often 0.
        before_session:
          type: integer
          description: >-
            Traffic used to prepare the browser before your session started
            (warm-up, for example a homepage visit). This is one of the ways we
            unblock sites with a high success rate. 0 when no warm-up ran.
        session_breakdown:
          $ref: '#/components/schemas/ResourceTypeBytes'
          description: >-
            `session_bytes` split by resource type. The values add up to
            `session_bytes`.
        before_session_breakdown:
          $ref: '#/components/schemas/ResourceTypeBytes'
          description: >-
            `before_session` split by resource type. The values add up to
            `before_session`.
    ErrorObject:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    ResourceTypeBytes:
      type: object
      description: Bytes per Chrome resource type.
      properties:
        document:
          type: integer
          description: HTML documents and frames.
        script:
          type: integer
          description: JavaScript files.
        stylesheet:
          type: integer
          description: CSS stylesheets.
        image:
          type: integer
          description: Images.
        font:
          type: integer
          description: Web fonts.
        media:
          type: integer
          description: Audio and video.
        other:
          type: integer
          description: >-
            Every resource type without its own field: XHR, Fetch, downloads,
            WebSocket, EventSource, Manifest, TextTrack, Prefetch, Preflight,
            Ping, CSPViolationReport and SignedExchange. Also resources Chrome
            reports as "Other" or with no type, and any future unmapped types.
  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

````