:doc:`BedrockAgentCore <../../bedrock-agentcore>` / Client / get_browser_session

*******************
get_browser_session
*******************



.. py:method:: BedrockAgentCore.Client.get_browser_session(**kwargs)

  

  Retrieves detailed information about a specific browser session in Amazon Bedrock AgentCore. This operation returns the session's configuration, current status, associated streams, and metadata.

   

  To get a browser session, you must specify both the browser identifier and the session ID. The response includes information about the session's viewport configuration, timeout settings, and stream endpoints.

   

  The following operations are related to ``GetBrowserSession``:

   

  
  * `StartBrowserSession <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StartBrowserSession.html>`__
   
  * `ListBrowserSessions <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_ListBrowserSessions.html>`__
   
  * `StopBrowserSession <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StopBrowserSession.html>`__
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agentcore-2024-02-28/GetBrowserSession>`_  


  **Request Syntax**
  ::

    response = client.get_browser_session(
        browserIdentifier='string',
        sessionId='string'
    )
    
  :type browserIdentifier: string
  :param browserIdentifier: **[REQUIRED]** 

    The unique identifier of the browser associated with the session.

    

  
  :type sessionId: string
  :param sessionId: **[REQUIRED]** 

    The unique identifier of the browser session to retrieve.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'browserIdentifier': 'string',
          'sessionId': 'string',
          'name': 'string',
          'createdAt': datetime(2015, 1, 1),
          'viewPort': {
              'width': 123,
              'height': 123
          },
          'extensions': [
              {
                  'location': {
                      's3': {
                          'bucket': 'string',
                          'prefix': 'string',
                          'versionId': 'string'
                      }
                  }
              },
          ],
          'profileConfiguration': {
              'profileIdentifier': 'string'
          },
          'sessionTimeoutSeconds': 123,
          'status': 'READY'|'TERMINATED',
          'streams': {
              'automationStream': {
                  'streamEndpoint': 'string',
                  'streamStatus': 'ENABLED'|'DISABLED'
              },
              'liveViewStream': {
                  'streamEndpoint': 'string'
              }
          },
          'proxyConfiguration': {
              'proxies': [
                  {
                      'externalProxy': {
                          'server': 'string',
                          'port': 123,
                          'domainPatterns': [
                              'string',
                          ],
                          'credentials': {
                              'basicAuth': {
                                  'secretArn': 'string'
                              }
                          }
                      }
                  },
              ],
              'bypass': {
                  'domainPatterns': [
                      'string',
                  ]
              }
          },
          'sessionReplayArtifact': 'string',
          'lastUpdatedAt': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **browserIdentifier** *(string) --* 

        The identifier of the browser.

        
      

      - **sessionId** *(string) --* 

        The identifier of the browser session.

        
      

      - **name** *(string) --* 

        The name of the browser session.

        
      

      - **createdAt** *(datetime) --* 

        The time at which the browser session was created.

        
      

      - **viewPort** *(dict) --* 

        The configuration that defines the dimensions of a browser viewport in a browser session. The viewport determines the visible area of web content and affects how web pages are rendered and displayed. Proper viewport configuration ensures that web content is displayed correctly for the agent's browsing tasks.

        
        

        - **width** *(integer) --* 

          The width of the viewport in pixels. This value determines the horizontal dimension of the visible area. Valid values range from 800 to 1920 pixels.

          
        

        - **height** *(integer) --* 

          The height of the viewport in pixels. This value determines the vertical dimension of the visible area. Valid values range from 600 to 1080 pixels.

          
    
      

      - **extensions** *(list) --* 

        The list of browser extensions that are configured in the browser session.

        
        

        - *(dict) --* 

          Browser extension configuration.

          
          

          - **location** *(dict) --* 

            The location where the browser extension files are stored. This specifies the source from which the extension will be loaded and installed.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``s3``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **s3** *(dict) --* 

              The Amazon S3 location of the resource. Use this when the resource is stored in an Amazon S3 bucket.

              
              

              - **bucket** *(string) --* 

                The name of the Amazon S3 bucket where the resource is stored.

                
              

              - **prefix** *(string) --* 

                The name of the Amazon S3 prefix/key where the resource is stored.

                
              

              - **versionId** *(string) --* 

                The name of the Amazon S3 version ID where the resource is stored (Optional).

                
          
        
      
    
      

      - **profileConfiguration** *(dict) --* 

        The browser profile configuration associated with this session. Contains the profile identifier that links to persistent browser data such as cookies and local storage.

        
        

        - **profileIdentifier** *(string) --* 

          The unique identifier of the browser profile. This identifier is used to reference the profile when starting new browser sessions or saving session data to the profile.

          
    
      

      - **sessionTimeoutSeconds** *(integer) --* 

        The timeout period for the browser session in seconds.

        
      

      - **status** *(string) --* 

        The current status of the browser session. Possible values include ACTIVE, STOPPING, and STOPPED.

        
      

      - **streams** *(dict) --* 

        The streams associated with this browser session. These include the automation stream and live view stream.

        
        

        - **automationStream** *(dict) --* 

          The stream that enables programmatic control of the browser. This stream allows agents to perform actions such as navigating to URLs, clicking elements, and filling forms.

          
          

          - **streamEndpoint** *(string) --* 

            The endpoint URL for the automation stream. This URL is used to establish a WebSocket connection to the stream for sending commands and receiving responses.

            
          

          - **streamStatus** *(string) --* 

            The current status of the automation stream. This indicates whether the stream is available for use. Possible values include ACTIVE, CONNECTING, and DISCONNECTED.

            
      
        

        - **liveViewStream** *(dict) --* 

          The stream that provides a visual representation of the browser content. This stream allows agents to observe the current state of the browser, including rendered web pages and visual elements.

          
          

          - **streamEndpoint** *(string) --* 

            The endpoint URL for the live view stream. This URL is used to establish a connection to receive visual updates from the browser session.

            
      
    
      

      - **proxyConfiguration** *(dict) --* 

        The active proxy configuration for this browser session. This field is only present if proxy configuration was provided when the session was started using ``StartBrowserSession``. The configuration includes proxy servers, domain bypass rules and the proxy authentication credentials.

        
        

        - **proxies** *(list) --* 

          An array of 1-5 proxy server configurations for domain-based routing. Each proxy can specify which domains it handles via ``domainPatterns``, enabling flexible routing of different traffic through different proxies based on destination domain.

          
          

          - *(dict) --* 

            Union type representing different proxy configurations. Currently supports external customer-managed proxies.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``externalProxy``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **externalProxy** *(dict) --* 

              Configuration for an external customer-managed proxy server.

              
              

              - **server** *(string) --* 

                The hostname of the proxy server. Must be a valid DNS hostname (maximum 253 characters).

                
              

              - **port** *(integer) --* 

                The port number of the proxy server. Valid range: 1-65535.

                
              

              - **domainPatterns** *(list) --* 

                Optional array of domain patterns that should route through this specific proxy. Supports ``.example.com`` for subdomain matching (matches any subdomain of example.com) or ``example.com`` for exact domain matching. If omitted, this proxy acts as a catch-all for domains not matched by other proxies. Maximum 100 patterns per proxy, each up to 253 characters.

                
                

                - *(string) --* 
            
              

              - **credentials** *(dict) --* 

                Optional authentication credentials for the proxy server. If omitted, the proxy is accessed without authentication (useful for IP-allowlisted proxies).

                .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``basicAuth``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


              
                

                - **basicAuth** *(dict) --* 

                  HTTP Basic Authentication credentials (username and password) stored in Amazon Web Services Secrets Manager.

                  
                  

                  - **secretArn** *(string) --* 

                    The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret containing proxy credentials. The secret must be a JSON object with ``username`` and ``password`` string fields that meet validation requirements. The caller must have ``secretsmanager:GetSecretValue`` permission for this ARN. Example secret format: ``{"username": "proxy_user", "password": "secure_password"}``

                    
              
            
          
        
      
        

        - **bypass** *(dict) --* 

          Optional configuration for domains that should bypass all proxies and connect directly to their destination, like the internet. Takes precedence over all proxy routing rules.

          
          

          - **domainPatterns** *(list) --* 

            Array of domain patterns that should bypass the proxy. Supports ``.amazonaws.com`` for subdomain matching or ``amazonaws.com`` for exact domain matching. Requests to these domains connect directly without using any proxy. Maximum 253 characters per pattern.

            
            

            - *(string) --* 
        
      
    
      

      - **sessionReplayArtifact** *(string) --* 

        The artifact containing the session replay information.

        
      

      - **lastUpdatedAt** *(datetime) --* 

        The time at which the browser session was last updated.

        
  
  **Exceptions**
  
  *   :py:class:`BedrockAgentCore.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ValidationException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ThrottlingException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.InternalServerException`

  