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

# List all browser tabs

> Retrieve a comprehensive list of all currently open browser tabs in the specified box. This endpoint returns detailed information about each tab including its id, title, current URL, and favicon. The returned id can be used for subsequent operations like navigation, closing, or updating tabs. This is essential for managing multiple browser sessions and understanding the current state of the browser environment.



## OpenAPI

````yaml get /boxes/{boxId}/browser/tabs
openapi: 3.0.0
info:
  title: GBOX Open API
  description: GBOX Open API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://gbox.ai/api/v1
    description: Production Server
security: []
tags: []
paths:
  /boxes/{boxId}/browser/tabs:
    get:
      tags:
        - Browser
      summary: List all browser tabs
      description: >-
        Retrieve a comprehensive list of all currently open browser tabs in the
        specified box. This endpoint returns detailed information about each tab
        including its id, title, current URL, and favicon. The returned id can
        be used for subsequent operations like navigation, closing, or updating
        tabs. This is essential for managing multiple browser sessions and
        understanding the current state of the browser environment.
      operationId: BrowserController_getTabs
      parameters:
        - name: boxId
          required: true
          in: path
          description: Box ID
          schema:
            example: c9bdc193-b54b-4ddb-a035-5ac0c598d32d
            type: string
      responses:
        '200':
          description: Successfully retrieved list of browser tabs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTabs'
      security:
        - bearer: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import GboxSDK from "gbox-sdk";

            const gboxSDK = new GboxSDK({
              apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
            });

            async function main() {
              const box = await gboxSDK.create({ type: "linux" });

              await box.browser.openTab("https://gbox.ai"); 

              const tabs = await box.browser.listTabs()

               console.log("Browser tabs:");
               for (const tab of tabs) {
                 console.log(`  Tab ${tab.data.id}: ${tab.data.title} - ${tab.data.url}`);
               }
            }

            main();
        - lang: Python
          source: |-
            import os
            from gbox_sdk import GboxSDK

            def main():
                gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])

                box = gbox_sdk.create(type="linux")

                box.browser.open_tab("https://gbox.ai")

                tabs = box.browser.list_tabs()

                print("Browser tabs:")
                for tab in tabs:
                    print(f"  Tab {tab.data.id}: {tab.data.title} - {tab.data.url}")

            if __name__ == "__main__":
                main()
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/gbox/gbox-sdk-go\"\n)\n\nfunc main() {\n\tgboxSDK := gbox.NewGboxSDK(os.Getenv(\"GBOX_API_KEY\"))\n\n\tbox, err := gboxSDK.Create(context.Background(), gbox.CreateOptions{Type: \"linux\"})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create linux box: %v\", err)\n\t}\n\n\terr = box.Browser.OpenTab(context.Background(), \"https://gbox.ai\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to open tab: %v\", err)\n\t}\n\n\ttabs, err := box.Browser.ListTabs(context.Background())\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to list browser tabs: %v\", err)\n\t}\n\n\tfmt.Println(\"Browser tabs:\")\n\tfor _, tab := range tabs {\n\t\tfmt.Printf(\"  Tab %s: %s - %s\\n\", tab.Data.ID, tab.Data.Title, tab.Data.URL)\n\t}\n}"
components:
  schemas:
    ListTabs:
      type: object
      properties:
        data:
          description: The tabs
          example:
            - id: '1'
              title: Google
              url: https://www.google.com
              favicon: https://www.google.com/favicon.ico
              active: true
              loading: false
            - id: '2'
              title: Bing
              url: https://www.bing.com
              favicon: https://www.bing.com/favicon.ico
              active: false
              loading: true
          type: array
          items:
            $ref: '#/components/schemas/BrowserTab'
      title: List Tabs
      description: List tabs
      required:
        - data
    BrowserTab:
      type: object
      properties:
        id:
          type: string
          description: The tab id
          example: '1'
          title: TabId
        title:
          type: string
          description: The tab title
          example: Google
          title: TabTitle
        url:
          type: string
          description: The tab url
          example: https://www.google.com
          title: TabUrl
        favicon:
          type: string
          description: The tab favicon
          example: https://www.google.com/favicon.ico
          title: TabFavicon
        active:
          type: boolean
          description: Whether the tab is the current active (frontmost) tab
          example: true
          title: TabActive
        loading:
          type: boolean
          description: >-
            Whether the tab is currently in a loading state.


            The value is **true** while the browser is still navigating to the
            target URL or fetching sub-resources (i.e. `document.readyState` is
            not "complete"). It typically switches to **false** once the `load`
            event fires and all major network activity has settled.
          example: false
          title: TabLoading
      title: Browser Tab
      description: Browser tab
      required:
        - id
        - title
        - url
        - favicon
        - active
        - loading
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Enter your API Key in the format: Bearer <token>. Get it from
        https://gbox.ai

````