Skip to main content
Get up and running with data extraction in under 5 minutes.

Setup

Install packages:
Set environment variables:
To get env variables, go over the Dashboard’s Settings tab:
Then copy your API Key directly from the input and set the BROWSERBASE_API_KEY environment variable.

Basic example

Python

Essential functions

Expected output

The agent response should contain five quotes with their authors: three from the first page and two from the second. The wording and formatting depend on the model response.

Cleanup

Ask the agent to close the current session using close_session, then confirm it ended in the Sessions dashboard. If the agent fails to close it, release the session using Manage browser sessions.

Python SDK

Use the Browserbase SDK from Python.

Browser contexts

Reuse cookies and browser state across sessions.