What do you want to do?
3 use cases
-
Pull structured data from a site with a schema
Use extract with a Zod or Pydantic schema to get typed data out of any page.
View prompt
Using browserbase/stagehand in <TypeScript or Python>, write a script that opens <url>, extracts every <item> on the page into a schema with fields <fields>, and saves the result as JSON. Read the API key from the environment.
-
Automate a logged-in workflow without giving the model your password
Use observe to find login fields and fill them yourself, then let act drive the rest of the task.
View prompt
Build a browserbase/stagehand script for <web app> that signs in using observe plus locator fill with credentials from environment variables, keeps the session in ./browser-data, then uses act to <task steps> and extract to save <data>. Never pass the password to the model.
-
Run browser automations in the cloud with action caching
Point the same Stagehand script at Browserbase and turn on caching so repeated actions spend no tokens.
View prompt
Move my existing browserbase/stagehand script <file> from a local browser to Browserbase: launch with browserbase.launch using BROWSERBASE_API_KEY, enable cache, drop the model config so the Model Gateway picks models, and run it twice to show the second run uses the cache.
Quick start with Stagehand
- Check you have what it needs: Node with pnpm, Python, or Go; Chrome installed for local runs; A model API key such as OPENAI_API_KEY, or a Browserbase API key to use the Model Gateway.
- Open browserbase/stagehand on GitHub and read the README and license.
- Install with
pnpm add @browserbasehq/stagehand 'zod@~4.4.3'orpip install stagehand - Launch a local browser and create a Stagehand instance with your model and API key
- Navigate with page.goto to the page you want
- Call Stagehand.extract with an instruction such as extract every invoice in the table and a schema describing the fields
These steps come from our top use case, Pull structured data from a site with a schema, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for browserbase/stagehand
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers automating websites or building browser agents who are tired of brittle selectors breaking on every redesign.
- Why it is hot26k stars, talked about in 2 AI sources we track
- LanguageTypeScript
- Sourcegithub.com/browserbase/stagehand ยท Back to Hot repos
Requirements
- Node with pnpm, Python, or Go
- Chrome installed for local runs
- A model API key such as OPENAI_API_KEY, or a Browserbase API key to use the Model Gateway
Add this badge to your README
Maintain Stagehand? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/browserbase-stagehand/?utm_source=github&utm_medium=badge&utm_campaign=browserbase-stagehand)
HTML
<a href="https://dedupedai.com/use-cases/browserbase-stagehand/?utm_source=github&utm_medium=badge&utm_campaign=browserbase-stagehand"><img src="https://dedupedai.com/badge/browserbase/stagehand.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Stagehand
What is Stagehand?
Stagehand is Browserbase's SDK for browser agents in TypeScript, Python and Go. It adds three AI methods to Playwright-style browser control: act to perform an action described in plain language, observe to find real selectors on the page, and extract to pull schema-validated data. Actions self-heal when a site changes, sessions persist in a user data directory, and the same script can run locally or on Browserbase. It is an open-source project on GitHub: https://github.com/browserbase/stagehand.
How do I use Stagehand?
Install with pnpm add @browserbasehq/stagehand 'zod@~4.4.3' or pip install stagehand; then launch a local browser and create a Stagehand instance with your model and API key; Navigate with page.goto to the page you want. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Stagehand for?
Developers automating websites or building browser agents who are tired of brittle selectors breaking on every redesign.
What can I do with Stagehand?
3 use cases so far, for example: Pull structured data from a site with a schema; Automate a logged-in workflow without giving the model your password; Run browser automations in the cloud with action caching. Each has steps and a copy-paste agent prompt.
What do I need to run Stagehand?
Node with pnpm, Python, or Go; Chrome installed for local runs; A model API key such as OPENAI_API_KEY, or a Browserbase API key to use the Model Gateway.
What are alternatives to Stagehand?
Other hot AI repos in Software and DevOps: ECC, Thinkrail, Superpowers, Deep Infer, Instructor.
Is Stagehand safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.