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

Setup

Install packages:
pip install browserbase playwright agno
Set environment variables:
export BROWSERBASE_API_KEY=your_api_key_here
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

from agno.agent import Agent
from agno.tools.browserbase import BrowserbaseTools

# Create extraction agent  
agent = Agent(
    name="Data Extractor",
    tools=[BrowserbaseTools()],
    instructions=[
        "Extract content clearly and format nicely",
        "Always close sessions when done"
    ],
    markdown=True,
)

# Extract quotes
response = agent.run("""
    Go to https://quotes.toscrape.com and:
    1. Get the first 3 quotes with authors
    2. Navigate to page 2  
    3. Get 2 more quotes from page 2
""")

print(response.content)

Essential functions

FunctionPurposeUsage
navigate_toGo to URL”Navigate to https://example.com
get_page_contentExtract HTML”Get the page content”
screenshotTake screenshot”Take screenshot, save as ‘page.png‘“
close_sessionEnd session”Close the current session”