Skip to content

Stagehand

Category: Framework

Free / Paid: Stagehand itself is free and open source (MIT license). Cloud browser infrastructure via Browserbase is a paid service. A local execution mode (using your installed Chrome) is available at no cost beyond LLM API fees.

Official site: https://stagehand.dev/

Docs: https://docs.stagehand.dev/

GitHub: https://github.com/browserbase/stagehand

What it is

Stagehand is an open source AI browser automation framework that provides four core primitives for writing browser automations using natural language instead of brittle CSS selectors:

PrimitiveWhat it does
actExecutes a natural language action on the page (e.g. "click the login button")
extractPulls structured data from the page using a schema
observeReturns a list of actionable elements visible on the page
agentRuns a multi-step autonomous agent loop to complete a goal

Available in both TypeScript and Python. Runs locally against an installed Chrome browser or in the cloud via Browserbase.

Safety and ToS notes

  • Stagehand is MIT licensed. No usage restrictions from the framework itself.
  • Cloud execution through Browserbase is subject to Browserbase Terms of Service.
  • An OPENAI_API_KEY (or compatible LLM provider key) is required for the AI primitives. Usage is subject to the respective LLM provider's ToS.
  • For local execution you must have Chrome installed. For cloud execution a Browserbase account and API key are required.

Quick navigation

  • Install - install command and environment setup
  • Usage - minimal working code example
  • Test - smoke-test command and expected output