stagehand
The SDK to extract data and interact with any site on the web. Get started with Claude Code, Codex, Eve, Mastra, and more.
What is stagehand?
The SDK to extract data and interact with any site on the web. Get started with Claude Code, Codex, Eve, Mastra, and more.
Overview of stagehand
What it is
Stagehand is an SDK for browser agents. It allows AI to use the browser like humans, enabling sign-in once, session persistence, and extraction of structured data. The SDK is available in TypeScript, Python, and Go.
Key features
- Familiar APIs: Playwright-style methods such as goto, click, locator, and screenshot.
- Token efficiency: Hybrid accessibility-tree trimming provides only the necessary page context.
- Faster in production: Runs as an extension next to the browser, reducing round-trip latency.
- Self-healing: act, observe, and extract refresh how an action happens when the site changes.
- Built for agents: Includes WebMCP, clipboard support, batch commands, deep locators for nested iframes and closed Shadow DOMs, and OTel traces.
- Three languages: One complete browser driver across TypeScript, Python, and Go.
Use cases
- Extracting structured data from web pages (e.g., invoices from a table).
- Automating browser interactions such as login, navigation, and form filling.
- Building browser-based AI agents that persist sessions and handle dynamic site changes.
Getting started
Install the SDK: bash pnpm add @browserbasehq/stagehand 'zod@~4.4.3' Python: bash pip install stagehand Go: bash go get github.com/browserbase/stagehand/packages/sdk-go/[email protected] Local runs need Chrome installed. For full setup, see the repository Quickstart.
License and pricing
The license is MIT. The project is open source.
Based on the project's public README and repository metadata.