Toolkits
Browserbase
BrowserbaseTools enable an Agent to automate browser interactions using Browserbase, a headless browser service.
Prerequisites
The following example requires Browserbase API credentials after you signup here, and the Playwright library.
Example
The following agent will use Browserbase to visit https://quotes.toscrape.com
and extract content. Then navigate to page two of the website and get quotes from there as well.
cookbook/tools/browserbase_tools.py
Toolkit Params
Parameter | Type | Default | Description |
---|---|---|---|
api_key | str | None | Browserbase API key. If not provided, uses BROWSERBASE_API_KEY env var. |
project_id | str | None | Browserbase project ID. If not provided, uses BROWSERBASE_PROJECT_ID env var. |
base_url | str | None | Custom Browserbase API endpoint URL. Only use this if you’re using a self-hosted Browserbase instance or need to connect to a different region. If not provided, uses BROWSERBASE_BASE_URL env var. |
Toolkit Functions
Function | Description |
---|---|
navigate_to | Navigates to a URL. Takes a URL and an optional connect_url parameter. |
screenshot | Takes a screenshot of the current page. Takes a path to save the screenshot, a boolean for full-page capture, and an optional connect_url parameter. |
get_page_content | Gets the HTML content of the current page. Takes an optional connect_url parameter. |
close_session | Closes a browser session. |