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();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()curl --request GET \
--url https://gbox.ai/api/v1/boxes/{boxId}/browser/tabs \
--header 'Authorization: Bearer <token>'{
"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
}
]
}Browser
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.
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();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()curl --request GET \
--url https://gbox.ai/api/v1/boxes/{boxId}/browser/tabs \
--header 'Authorization: Bearer <token>'{
"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
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Path Parameters
Box ID
Example:
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Response
200 - application/json
Successfully retrieved list of browser tabs
List tabs
The tabs
Show child attributes
Show child attributes
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
}
]
Was this page helpful?