Quick Use
- Sign up at browserbase.com — copy your API key + project ID
npm install @browserbasehq/stagehand- Set BROWSERBASE_API_KEY + BROWSERBASE_PROJECT_ID env vars and use the Stagehand snippet below
Intro
Browserbase is the cloud Chromium platform behind Stagehand and most production AI browser-automation stacks. Spin up a browser via API, drive it with Playwright or Stagehand, get back screenshots, network logs, and full session replay — without managing Chrome on your own infra. Best for: agents that need persistent browser sessions, residential proxies, or 100+ parallel scraping jobs. Works with: Stagehand, Playwright, Puppeteer, Selenium, Browser Use. Setup time: 2 minutes (sign up + API key).
What you get
| Feature | Detail |
|---|---|
| Managed Chromium | Latest Chrome on Linux, no version drift |
| Parallel sessions | 100+ concurrent on Pro, scales further on Scale plan |
| Residential proxies | Built-in IP rotation, US/EU/Asia regions |
| Session replay | Full video + DOM snapshots for debugging |
| Stealth mode | Bypass bot detection on most major sites |
| Persistent contexts | Save cookies/localStorage across runs (logged-in scraping) |
Connect from Stagehand
import { Stagehand } from "@browserbasehq/stagehand";
const stagehand = new Stagehand({
env: "BROWSERBASE", // not LOCAL
apiKey: process.env.BROWSERBASE_API_KEY,
projectId: process.env.BROWSERBASE_PROJECT_ID,
});
await stagehand.init();
// Drive with natural language
await stagehand.act("Click the login button");
await stagehand.act("Fill in email with foo@bar.com");
// Or extract structured data
const products = await stagehand.extract({
instruction: "Get all product names and prices on this page",
schema: z.object({
products: z.array(z.object({
name: z.string(),
price: z.number(),
})),
}),
});Connect from Playwright
from playwright.sync_api import sync_playwright
import os
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(
f"wss://connect.browserbase.com?apiKey={os.environ['BROWSERBASE_API_KEY']}"
)
page = browser.new_page()
page.goto("https://example.com")
page.screenshot(path="example.png")Pricing snapshot
- Free tier: 1 hour of browser time / month, no credit card
- Pro: starts $99/mo for ~150 hours
- Scale: custom for >1000 hours/mo, residential proxies, dedicated infra
FAQ
Q: Is Browserbase free? A: Yes — there's a free tier with 1 hour of browser time per month, no credit card. Paid plans start at $99/mo for production workloads.
Q: How is this different from Stagehand? A: Stagehand is the automation library (the natural-language API that drives the browser). Browserbase is the infrastructure (the cloud Chromium that Stagehand connects to). Stagehand also runs locally, but Browserbase makes it scale.
Q: Can my AI agent stay logged in across sessions? A: Yes — Browserbase persistent contexts save cookies and localStorage. Pass the contextId on the next session and the browser resumes logged-in state. Critical for scraping authenticated dashboards.
Source & Thanks
Built by Browserbase. Commercial product with free tier.
browserbase/sdk-node — ⭐ Active SDK