Repolode
browserbase

browserbase/stagehand

TypeScript, Python and Go SDK for browser agents that drives Chrome with natural-language act, observe and extract calls alongside Playwright-style APIs.

Stars
25,748
Forks
1,769
Open issues
371
Last commit
yesterday

What is it?

Stagehand is an SDK for building browser agents that control a real browser and pull structured data from web pages. It layers three natural-language primitives, act, observe and extract, on top of Playwright-style page and locator APIs, so a script can click through a site, find elements and return data validated against a schema such as Zod or Pydantic.

It runs against a local Chrome installation or against Browserbase's hosted browsers, which add proxies, persistent contexts and session recordings. Observe returns concrete selectors, letting code handle sensitive inputs without sending them to the model. The project also includes separate fetch and search helpers for retrieving page content as markdown without launching a browser, and a hosted MCP server that exposes browser tools to coding agents.

The SDK is available in TypeScript, Python and Go, and is organized as a monorepo with examples and integrations for frameworks such as Mastra, CrewAI and the Vercel AI SDK.

Key features

  • 01Playwright-style page and locator APIs for browser control.
  • 02act, observe and extract methods that take natural-language instructions.
  • 03Schema-validated data extraction with Zod or Pydantic.
  • 04Local Chrome support plus Browserbase hosted browsers with proxies and session recordings.
  • 05Fetch and search helpers that return web content without launching a browser.
  • 06TypeScript, Python and Go SDKs.

Use cases

  • Scraping structured tables or lists from sites that lack an API.
  • Automating multi-step web workflows such as logins and form submissions.
  • Giving coding agents a browser through the hosted MCP server.
  • Migrating an existing Playwright test suite toward natural-language steps.

Quick start

  1. 1

    Install the TypeScript SDK with pnpm

    pnpm add @browserbasehq/stagehand 'zod@~4.4.3'
  2. 2

    Install Google Chrome for local browser runs

  3. 3

    Or install the Python SDK with pip

    pip install stagehand

Things to know

  • Local runs require Chrome to be installed on the machine.
  • The act, observe and extract calls need a model API key, such as OpenAI, unless you run through Browserbase.

Topics

FAQ

What is stagehand?
TypeScript, Python and Go SDK for browser agents that drives Chrome with natural-language act, observe and extract calls alongside Playwright-style APIs. Stagehand is an SDK for building browser agents that control a real browser and pull structured data from web pages. It layers three natural-language primitives, act, observe and extract, on top of Playwright-style page and locator APIs, so a script can click through a site, find elements and return data validated against a schema such as Zod or Pydantic.
Is stagehand free to use? What license does it have?
stagehand is open source under the MIT license. Check the license terms before using it in commercial products.
Is stagehand still maintained?
Actively maintained. The last commit to stagehand was on Oct 20, 2026.
What can I use stagehand for?
Scraping structured tables or lists from sites that lack an API. Automating multi-step web workflows such as logins and form submissions. Giving coding agents a browser through the hosted MCP server. Migrating an existing Playwright test suite toward natural-language steps.
How do I install stagehand?
Install the TypeScript SDK with pnpm: pnpm add @browserbasehq/stagehand 'zod@~4.4.3' Install Google Chrome for local browser runs Or install the Python SDK with pip: pip install stagehand
Where can I get stagehand?
The source code and installation instructions are on GitHub: https://github.com/browserbase/stagehand

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects