Stagehand is an open-source browser automation SDK that replaces CSS selectors with natural language instructions, built by Browserbase on top of Playwright.
Stagehand is an open-source browser automation SDK built by Browserbase. It lets developers write browser automations using natural language instructions — so instead of writing document.querySelector('.submit-btn'), you write "click the submit button" and the AI figures out what to click at runtime.
It sits on top of the Chrome DevTools Protocol and is designed to solve a specific, persistent problem with traditional browser automation: fragile selectors that break every time a website changes its HTML structure.
Stagehand gives you four core operations for controlling a browser programmatically:
act() takes a plain-English instruction and carries it out. You tell it what to do — “fill in the email field with user@example.com” or “click the button that says Continue” — and Stagehand determines how to execute it on the current page.
extract() pulls structured data from a page. You define a schema for what you want — say, a list of product names and prices — and Stagehand reads the page and returns the data in that shape.
observe() scans the page and returns a list of elements that can be acted on. Useful when you want to understand what’s available before deciding what to do next.
agent() runs multi-step workflows where Stagehand plans and executes a sequence of actions to accomplish a goal, rather than you specifying each step individually.
The result is automation that is more resilient than traditional Playwright or Selenium scripts, because instructions are resolved against the live DOM at the time they run — not against hardcoded selectors that were accurate when someone wrote the test.
Stagehand is used by engineering teams that write browser automation at scale and have run into the maintenance problem: a site changes, a selector breaks, a pipeline fails, someone gets paged at 2am. Stagehand’s natural language layer means those pipelines survive page redesigns without constant patching.
More specifically, it is used by teams building:
Stagehand has crossed 50,000 GitHub stars since its launch — which reflects both genuine usefulness and the broader demand for browser agents that require less maintenance.
Stagehand v3 communicates with the browser directly via the Chrome DevTools Protocol (CDP), which gives it low-level control over browser sessions without requiring a full browser automation framework as an intermediary. This CDP-native architecture improved performance by roughly 44% on complex DOM interactions compared to earlier versions that ran on top of Playwright.
When you call act() with a natural language instruction, Stagehand sends the current state of the page — a condensed representation of the DOM — to an LLM along with your instruction. The model identifies which element to interact with and what action to take, then Stagehand executes that action through CDP. The result is returned to your code.
This means Stagehand requires an LLM API key to work. The LLM is only called when natural language resolution is needed — if you write deterministic selectors alongside natural language instructions, Stagehand uses the selectors directly without calling the model, which keeps costs and latency down for predictable interactions.
For the Browserbase cloud option, browser sessions run on Browserbase’s managed infrastructure. Session replay lets you review what the browser did step by step — useful for debugging agent workflows that took an unexpected path.
Web research agents. An AI agent that researches a topic needs to navigate multiple sites, extract information, and synthesize it. Stagehand handles the navigation and extraction layer, letting the agent focus on reasoning rather than DOM parsing.
Job application automation. An agent that searches job boards, extracts listings matching a candidate’s profile, and fills in application forms needs to handle dozens of different site layouts. Stagehand’s natural language instructions adapt to each site’s structure rather than requiring custom code per site.
Competitive monitoring. A business intelligence tool that checks competitor pricing, product listings, or job postings daily needs automation that survives website redesigns. Stagehand pipelines stay valid through layout changes that would break traditional scrapers.
End-to-end QA testing. Engineering teams writing acceptance tests for their own products benefit from test scripts that describe user intent rather than specific DOM selectors. When the frontend is redesigned, Stagehand-based tests remain valid without a rewrite.
The Stagehand SDK is open-source under the MIT licence and free to use. You can run it locally against any Chromium-based browser at no cost, aside from the LLM API calls it makes to resolve natural language instructions (which are billed by your chosen model provider at their standard rates).
The optional Browserbase cloud is a paid service. It provides managed browser infrastructure, session replay, and parallel session support. Pricing is usage-based; a free trial is available. For teams that want to run automations locally or on their own infrastructure, Browserbase is not required.
Install the SDK with npm install @browserbasehq/stagehand and add your LLM provider API key to your environment. The core library runs locally without any additional account setup.
The Stagehand documentation at stagehand.dev includes quickstart examples for the main primitives — act, extract, observe, and agent. A good first project is writing a simple scraper: pick a public website, use extract() to pull structured data from it, and compare the result to what you would have to write in raw Playwright to accomplish the same thing.
If you want to run agents at scale or need session replay for debugging, create an account at browserbase.com and add a Browserbase API key alongside your LLM key.
Stagehand is used to write browser automations that are more resilient and readable than traditional selector-based scripts. Primary uses include AI agents that browse the web, web scrapers that need to survive page changes, QA test suites for JavaScript-heavy applications, and multi-step automation workflows.
No. Stagehand is a layer on top of browser automation that talks directly to CDP. The difference in practice is that Playwright requires you to write precise selectors and scripted actions, while Stagehand lets you write natural language instructions that the AI resolves against the live page. For deterministic, high-volume automation, Playwright is faster and cheaper. Stagehand adds value when page variability is high.
Yes. The core Stagehand SDK runs entirely locally against any Chromium browser. Browserbase is an optional managed cloud that adds production infrastructure features like parallel sessions and session replay. You only need Browserbase if you want to run automations at scale without managing browser infrastructure yourself.
Browser Use is an open-source Python library that lets AI agents control a real web browser to click, type, and extract data using natural language.
Browser AgentComputer use is Anthropic's API capability that gives Claude screenshot vision plus mouse and keyboard control to operate desktop applications autonomously.
Browser AgentUpdates from the AI world — what shipped, what we’re using in production, and what’s worth your attention. Two emails a month, no spam.