GET
/
boxes
/
{boxId}
/
browser
/
tabs
JavaScript
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();
{
  "data": [
    {
      "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
    }
  ]
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Response

200 - application/json

Successfully retrieved list of browser tabs

List tabs

data
Browser Tab · object[]
required

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
}
]