# Stagehand - [Introducing Stagehand](https://docs.stagehand.dev/v4/first-steps/introduction.md): Developers use Stagehand to reliably automate the web. - [Quickstart](https://docs.stagehand.dev/v4/first-steps/quickstart.md): Build your first Stagehand automation with act, extract, and observe. - [Installation](https://docs.stagehand.dev/v4/first-steps/installation.md): Add Stagehand to an existing project. - [AI rules](https://docs.stagehand.dev/v4/first-steps/ai-rules.md): Give your AI coding assistant the rules it needs to write correct Stagehand v4 code. - [Act](https://docs.stagehand.dev/v4/basics/act.md): Interact with a web page - [Extract](https://docs.stagehand.dev/v4/basics/extract.md): Extract structured data from a webpage - [Observe](https://docs.stagehand.dev/v4/basics/observe.md): Discover and plan executable actions on any web page - [WebMCP](https://docs.stagehand.dev/v4/basics/webmcp.md): List and invoke tools registered by the current web page - [Browser](https://docs.stagehand.dev/v4/configuration/browser.md): Configure Stagehand on Browserbase or locally - [Models](https://docs.stagehand.dev/v4/configuration/models.md): Use any LLM with Stagehand - [Logging](https://docs.stagehand.dev/v4/configuration/logging.md): Control terminal output and forward structured Stagehand logs - [Observability](https://docs.stagehand.dev/v4/configuration/observability.md): Track Stagehand automation with session visibility and analytics - [Integrations](https://docs.stagehand.dev/v4/integrations/overview.md): Connect Claude Code, Codex, CrewAI, Deep Agents, Eve, Mastra, fx, Pi, or the Vercel AI SDK to a persistent Stagehand browser. - [Claude Code](https://docs.stagehand.dev/v4/integrations/claude-code.md): Give a Claude Code agent persistent Stagehand browser tools over MCP/stdio. - [Codex](https://docs.stagehand.dev/v4/integrations/codex.md): Give a Codex agent persistent Stagehand browser tools over MCP/stdio. - [Eve](https://docs.stagehand.dev/v4/integrations/eve.md): Give Eve, Vercel's framework for building agents, native Stagehand browser tools backed by one durable browser session. - [Deep Agents](https://docs.stagehand.dev/v4/integrations/deep-agents.md): Give LangChain Deep Agents persistent Stagehand tools locally or in a managed deployment. - [CrewAI](https://docs.stagehand.dev/v4/integrations/crewai.md): Give a CrewAI agent persistent Stagehand browser tools over MCP/stdio. - [Mastra](https://docs.stagehand.dev/v4/integrations/mastra.md): Give a Mastra agent persistent Stagehand browser tools over MCP/stdio. - [fx](https://docs.stagehand.dev/v4/integrations/fx.md): Give the fx coding agent persistent Stagehand browser tools over MCP/stdio. - [Pi](https://docs.stagehand.dev/v4/integrations/pi.md): Give the Pi coding agent native Stagehand browser tools registered directly by an extension. - [Vercel AI SDK](https://docs.stagehand.dev/v4/integrations/vercel-ai-sdk.md): Give a Vercel AI SDK agent persistent Stagehand browser tools over MCP/stdio. - [Prompting best practices](https://docs.stagehand.dev/v4/best-practices/prompting-best-practices.md): Write effective prompts for reliable Stagehand automation - [Observe use cases](https://docs.stagehand.dev/v4/best-practices/usecase-observe.md): Real-world patterns for planning automations with observe() - [Caching actions](https://docs.stagehand.dev/v4/best-practices/caching.md): Cache actions automatically to reduce costs and improve performance - [Using multiple tabs](https://docs.stagehand.dev/v4/best-practices/using-multiple-tabs.md): Act on multiple tabs with Stagehand - [User data](https://docs.stagehand.dev/v4/best-practices/user-data.md): Persist browser data between sessions - [Speed optimization](https://docs.stagehand.dev/v4/best-practices/speed-optimization.md): Optimize Stagehand performance for faster automation and reduced latency - [Cost optimization](https://docs.stagehand.dev/v4/best-practices/cost-optimization.md): Minimize costs while maintaining automation performance - [Deploying Stagehand](https://docs.stagehand.dev/v4/best-practices/deployments.md): Deploy your AI agents and automations to the cloud - [MCP integrations](https://docs.stagehand.dev/v4/best-practices/mcp-integrations.md): Call Model Context Protocol (MCP) servers alongside Stagehand's primitives - [Migrate v3 to v4](https://docs.stagehand.dev/v4/migrations/v3.md) - [Migrate Playwright to v4](https://docs.stagehand.dev/v4/migrations/playwright.md) - [Stagehand](https://docs.stagehand.dev/v4/reference/stagehand.md): Initialize a browser session and run AI-powered actions, observations, and extractions - [context](https://docs.stagehand.dev/v4/reference/context.md): Manage pages, cookies, headers, policies, and clipboard access within a browser context - [clipboard](https://docs.stagehand.dev/v4/reference/clipboard.md): Read, write, and dispatch clipboard operations in the browser - [page](https://docs.stagehand.dev/v4/reference/page.md): Navigate, inspect, and interact with a browser page - [WebMCP](https://docs.stagehand.dev/v4/reference/webmcp.md): Inspect and invoke page-provided WebMCP tools - [response](https://docs.stagehand.dev/v4/reference/response.md): Inspect the main-document network response returned by page navigation - [locator](https://docs.stagehand.dev/v4/reference/locator.md): Target elements and perform focused DOM interactions - [Introducing Stagehand](https://docs.stagehand.dev/v3/first-steps/introduction.md): Developers use Stagehand to reliably automate the web. - [Quickstart](https://docs.stagehand.dev/v3/first-steps/quickstart.md): Stagehand allows you to build web automations with natural language and code. - [Installation](https://docs.stagehand.dev/v3/first-steps/installation.md): Integrate Stagehand into an existing project. - [AI Rules](https://docs.stagehand.dev/v3/first-steps/ai-rules.md): Using AI to write Stagehand code faster, and better. - [Agent](https://docs.stagehand.dev/v3/basics/agent.md): Automate complex workflows with AI powered browser agents - [Act](https://docs.stagehand.dev/v3/basics/act.md): Interact with a web page - [Extract](https://docs.stagehand.dev/v3/basics/extract.md): Extract structured data from a webpage - [Observe](https://docs.stagehand.dev/v3/basics/observe.md): Discover and plan executable actions on any web page - [WebMCP](https://docs.stagehand.dev/v3/basics/webmcp.md): List and invoke tools registered by the current web page - [Evaluations & Metrics](https://docs.stagehand.dev/v3/basics/evals.md): Monitor performance, optimize costs, and evaluate LLM effectiveness - [Browser](https://docs.stagehand.dev/v3/configuration/browser.md): Configure Stagehand on Browserbase or locally - [Observability](https://docs.stagehand.dev/v3/configuration/observability.md): Track Stagehand automation with session visibility and analytics - [Logging](https://docs.stagehand.dev/v3/configuration/logging.md): Set up logging, debugging, and error tracking for Stagehand workflows - [Models](https://docs.stagehand.dev/v3/configuration/models.md): Use any LLM with Stagehand - [Caching Actions](https://docs.stagehand.dev/v3/best-practices/caching.md): Cache actions automatically to reduce costs and improve performance - [Cost Optimization](https://docs.stagehand.dev/v3/best-practices/cost-optimization.md): Minimize costs while maintaining automation performance - [Deterministic Agent Scripts](https://docs.stagehand.dev/v3/best-practices/deterministic-agent.md): Use auto-caching to convert agent workflows into fast, deterministic scripts - [Using Multiple Tabs](https://docs.stagehand.dev/v3/best-practices/using-multiple-tabs.md): Act on multiple tabs with Stagehand - [Deploying Stagehand](https://docs.stagehand.dev/v3/best-practices/deployments.md): Deploy your AI agents and automations to the cloud - [History Tracking](https://docs.stagehand.dev/v3/best-practices/history.md): Track and analyze Stagehand operations with the history API - [Computer Use Agents](https://docs.stagehand.dev/v3/best-practices/computer-use.md): Incorporate Computer Use APIs from Google, Anthropic, OpenAI, and Microsoft with one line of code in Stagehand. - [Agent Fallbacks](https://docs.stagehand.dev/v3/best-practices/agent-fallbacks.md): A failsafe when unexpected page changes add extra steps - [Prompting Best Practices](https://docs.stagehand.dev/v3/best-practices/prompting-best-practices.md): Write effective prompts for reliable Stagehand automation - [MCP Integrations](https://docs.stagehand.dev/v3/best-practices/mcp-integrations.md): Using Model Context Protocol (MCP) integrations to enhance agent capabilities - [Speed Optimization](https://docs.stagehand.dev/v3/best-practices/speed-optimization.md): Optimize Stagehand performance for faster automation and reduced latency - [Browserbase MCP Server](https://docs.stagehand.dev/v3/integrations/mcp/introduction.md): AI-powered browser automation through Model Context Protocol integration with Stagehand - [Browserbase MCP Server Setup](https://docs.stagehand.dev/v3/integrations/mcp/setup.md): Add the Browserbase MCP Server to your MCP client - [Browserbase MCP Server Tools](https://docs.stagehand.dev/v3/integrations/mcp/tools.md): This guide covers the specialized tools available in the Browserbase MCP server for browser automation and interaction. - [Browserbase MCP Server Configuration](https://docs.stagehand.dev/v3/integrations/mcp/configuration.md): Configure your browser automation with command-line flags, environment variables, and advanced options - [CrewAI Introduction](https://docs.stagehand.dev/v3/integrations/crew-ai/introduction.md): Automate browser tasks using natural language instructions with CrewAI - [Use CrewAI to Automate Browser Tasks](https://docs.stagehand.dev/v3/integrations/crew-ai/configuration.md): Create intelligent agents that can interact with websites and automate browser tasks using natural language instructions - [Langchain JS Introduction](https://docs.stagehand.dev/v3/integrations/langchain/introduction.md): Integrate Stagehand with Langchain JS for intelligent web automation - [LangChain JS Configuration](https://docs.stagehand.dev/v3/integrations/langchain/configuration.md): Set up Stagehand with LangChain JS to create intelligent web automation agents - [Next.js + Vercel](https://docs.stagehand.dev/v3/integrations/vercel/introduction.md): Build and deploy a Stagehand‑powered Next.js app to Vercel - [Use Stagehand in Next.js](https://docs.stagehand.dev/v3/integrations/vercel/configuration.md): Next.js is a popular framework for developing web-based applications in production. It powers Stagehand apps like [Brainrot](https://brainrot.run) and [Open Operator](https://operator.browserbase.com). - [Convex](https://docs.stagehand.dev/v3/integrations/convex/introduction.md): AI-powered browser automation for Convex applications - [Use Stagehand in Convex](https://docs.stagehand.dev/v3/integrations/convex/configuration.md): Set up AI-powered browser automation in your Convex application - [Playwright](https://docs.stagehand.dev/v3/integrations/playwright.md): Use Stagehand with Playwright for browser automation - [Puppeteer](https://docs.stagehand.dev/v3/integrations/puppeteer.md): Use Stagehand with Puppeteer for browser automation - [Selenium](https://docs.stagehand.dev/v3/integrations/selenium.md): Use Stagehand with Selenium to operate the same browser in tandem - [Stagehand](https://docs.stagehand.dev/v3/references/stagehand.md): Complete API reference for the Stagehand class - [agent()](https://docs.stagehand.dev/v3/references/agent.md): Complete API reference for the agent() method - [act()](https://docs.stagehand.dev/v3/references/act.md): Complete API reference for the act() method - [extract()](https://docs.stagehand.dev/v3/references/extract.md): Complete API reference for the extract() method - [observe()](https://docs.stagehand.dev/v3/references/observe.md): Complete API reference for the observe() method - [context](https://docs.stagehand.dev/v3/references/context.md): Complete API reference for the browser context - [clipboard](https://docs.stagehand.dev/v3/references/clipboard.md): Complete API reference for the browser clipboard - [page](https://docs.stagehand.dev/v3/references/page.md): Complete API reference for the Stagehand Page object - [locator](https://docs.stagehand.dev/v3/references/locator.md): Complete API reference for the Locator class - [deepLocator](https://docs.stagehand.dev/v3/references/deeplocator.md): Complete API reference for the deepLocator method - [Response](https://docs.stagehand.dev/v3/references/response.md): Complete API reference for the Response object - [Migrate TypeScript v2 to v3](https://docs.stagehand.dev/v3/migrations/v2.md): Complete migration guide from Stagehand TypeScript SDK v2 to v3 - [Migrate Python v2 to v3](https://docs.stagehand.dev/v3/migrations/python.md): Complete migration guide from Stagehand Python SDK v2 to the new Stainless-based v3 SDK - [Python SDK](https://docs.stagehand.dev/v3/sdk/python.md): Official Stagehand SDK for Python - [Start a new browser session](https://docs.stagehand.dev/v3/api-reference/python/start-a-new-browser-session.md): Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations. - [Navigate to a URL](https://docs.stagehand.dev/v3/api-reference/python/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Perform an action](https://docs.stagehand.dev/v3/api-reference/python/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Observe available actions](https://docs.stagehand.dev/v3/api-reference/python/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Extract data from the page](https://docs.stagehand.dev/v3/api-reference/python/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Execute an AI agent](https://docs.stagehand.dev/v3/api-reference/python/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [End a browser session](https://docs.stagehand.dev/v3/api-reference/python/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Replay session metrics](https://docs.stagehand.dev/v3/api-reference/python/replay-session-metrics.md): Retrieves replay metrics for a session. - [Java SDK](https://docs.stagehand.dev/v3/sdk/java.md): Official Stagehand SDK for Java - [Start a new browser session](https://docs.stagehand.dev/v3/api-reference/java/start-a-new-browser-session.md): Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations. - [Navigate to a URL](https://docs.stagehand.dev/v3/api-reference/java/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Perform an action](https://docs.stagehand.dev/v3/api-reference/java/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Observe available actions](https://docs.stagehand.dev/v3/api-reference/java/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Extract data from the page](https://docs.stagehand.dev/v3/api-reference/java/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Execute an AI agent](https://docs.stagehand.dev/v3/api-reference/java/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [End a browser session](https://docs.stagehand.dev/v3/api-reference/java/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Replay session metrics](https://docs.stagehand.dev/v3/api-reference/java/replay-session-metrics.md): Retrieves replay metrics for a session. - [Go SDK](https://docs.stagehand.dev/v3/sdk/go.md): Official Stagehand SDK for Go - [Start a new browser session](https://docs.stagehand.dev/v3/api-reference/go/start-a-new-browser-session.md): Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations. - [Navigate to a URL](https://docs.stagehand.dev/v3/api-reference/go/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Perform an action](https://docs.stagehand.dev/v3/api-reference/go/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Observe available actions](https://docs.stagehand.dev/v3/api-reference/go/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Extract data from the page](https://docs.stagehand.dev/v3/api-reference/go/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Execute an AI agent](https://docs.stagehand.dev/v3/api-reference/go/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [End a browser session](https://docs.stagehand.dev/v3/api-reference/go/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Replay session metrics](https://docs.stagehand.dev/v3/api-reference/go/replay-session-metrics.md): Retrieves replay metrics for a session. - [Ruby SDK](https://docs.stagehand.dev/v3/sdk/ruby.md): Official Stagehand SDK for Ruby - [Start a new browser session](https://docs.stagehand.dev/v3/api-reference/ruby/start-a-new-browser-session.md): Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations. - [Navigate to a URL](https://docs.stagehand.dev/v3/api-reference/ruby/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Perform an action](https://docs.stagehand.dev/v3/api-reference/ruby/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Observe available actions](https://docs.stagehand.dev/v3/api-reference/ruby/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Extract data from the page](https://docs.stagehand.dev/v3/api-reference/ruby/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Execute an AI agent](https://docs.stagehand.dev/v3/api-reference/ruby/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [End a browser session](https://docs.stagehand.dev/v3/api-reference/ruby/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Replay session metrics](https://docs.stagehand.dev/v3/api-reference/ruby/replay-session-metrics.md): Retrieves replay metrics for a session. - [Introducing Stagehand](https://docs.stagehand.dev/v2/first-steps/introduction.md): Developers use Stagehand to reliably automate the web. - [Quickstart](https://docs.stagehand.dev/v2/first-steps/quickstart.md): Stagehand allows you to build web automations with natural language and code. - [Installation](https://docs.stagehand.dev/v2/first-steps/installation.md): Integrate Stagehand into an existing project. - [AI Rules](https://docs.stagehand.dev/v2/first-steps/ai-rules.md): Using AI to write Stagehand code faster, and better. - [Agent](https://docs.stagehand.dev/v2/basics/agent.md): Automate complex workflows with AI powered browser agents - [Act](https://docs.stagehand.dev/v2/basics/act.md): Interact with a web page - [Extract](https://docs.stagehand.dev/v2/basics/extract.md): Extract structured data from a webpage - [Observe](https://docs.stagehand.dev/v2/basics/observe.md): Find suggested actions for your workflows - [Browser](https://docs.stagehand.dev/v2/configuration/browser.md): Configure Stagehand on Browserbase or locally - [Observability](https://docs.stagehand.dev/v2/configuration/observability.md): Track Stagehand automation with session visibility and analytics - [Logging & Debugging](https://docs.stagehand.dev/v2/configuration/logging.md): Set up logging, debugging, and error tracking for Stagehand workflows - [Models](https://docs.stagehand.dev/v2/configuration/models.md): Enhance Stagehand with LLMs for optimal performance, cost, and reliability - [Evaluations & Metrics](https://docs.stagehand.dev/v2/configuration/evals.md): Monitor performance, optimize costs, and evaluate LLM effectiveness - [Caching Actions](https://docs.stagehand.dev/v2/best-practices/caching.md): You can cache actions in Stagehand to avoid redundant LLM calls. - [Cost Optimization](https://docs.stagehand.dev/v2/best-practices/cost-optimization.md): Minimize costs while maintaining automation performance - [Using Multiple Tabs](https://docs.stagehand.dev/v2/best-practices/using-multiple-tabs.md): Act on multiple tabs with Stagehand - [Working with iframes](https://docs.stagehand.dev/v2/best-practices/working-with-iframes.md) - [Deploying Stagehand](https://docs.stagehand.dev/v2/best-practices/deployments.md): Deploy your AI agents and automations to the cloud - [Computer Use Agents](https://docs.stagehand.dev/v2/best-practices/computer-use.md): Incorporate Computer Use APIs from Anthropic and OpenAI with one line of code in Stagehand. - [Contribute to Stagehand](https://docs.stagehand.dev/v2/best-practices/contributing.md): Best practices for making a meaningful contribution to Stagehand - [Playwright Interoperability](https://docs.stagehand.dev/v2/best-practices/playwright-interop.md): How Stagehand interacts with Playwright - [Build a web browsing agent](https://docs.stagehand.dev/v2/best-practices/build-agent.md): Build an AI agent that can autonomously control a browser with Stagehand - [Agent Fallbacks](https://docs.stagehand.dev/v2/best-practices/agent-fallbacks.md): A failsafe when unexpected page changes add extra steps - [Prompting Best Practices](https://docs.stagehand.dev/v2/best-practices/prompting-best-practices.md): Write effective prompts for reliable Stagehand automation - [MCP Integrations](https://docs.stagehand.dev/v2/best-practices/mcp-integrations.md): Using Model Context Protocol (MCP) integrations to enhance agent capabilities - [Speed Optimization](https://docs.stagehand.dev/v2/best-practices/speed-optimization.md): Optimize Stagehand performance for faster automation and reduced latency - [Browserbase MCP Server](https://docs.stagehand.dev/v2/integrations/mcp/introduction.md): AI-powered browser automation through Model Context Protocol integration with Stagehand - [Browserbase MCP Server Setup](https://docs.stagehand.dev/v2/integrations/mcp/setup.md): Add the Browserbase MCP Server to your MCP client - [Browserbase MCP Server Tools](https://docs.stagehand.dev/v2/integrations/mcp/tools.md): This guide covers the specialized tools available in the Browserbase MCP server for browser automation and interaction. - [Browserbase MCP Server Configuration](https://docs.stagehand.dev/v2/integrations/mcp/configuration.md): Configure your browser automation with command-line flags, environment variables, and advanced options - [CrewAI Introduction](https://docs.stagehand.dev/v2/integrations/crew-ai/introduction.md): Automate browser tasks using natural language instructions with CrewAI - [Use CrewAI to Automate Browser Tasks](https://docs.stagehand.dev/v2/integrations/crew-ai/configuration.md): Create intelligent agents that can interact with websites and automate browser tasks using natural language instructions - [Langchain JS Introduction](https://docs.stagehand.dev/v2/integrations/langchain/introduction.md): Integrate Stagehand with Langchain JS for intelligent web automation - [LangChain JS Configuration](https://docs.stagehand.dev/v2/integrations/langchain/configuration.md): Set up Stagehand with LangChain JS to create intelligent web automation agents - [Next.js + Vercel](https://docs.stagehand.dev/v2/integrations/vercel/introduction.md): Build and deploy a Stagehand‑powered Next.js app to Vercel - [Use Stagehand in Next.js](https://docs.stagehand.dev/v2/integrations/vercel/configuration.md): Next.js is a popular framework for developing web-based applications in production. It powers Stagehand apps like [Brainrot](https://brainrot.run) and [Open Operator](https://operator.browserbase.com). - [Stagehand](https://docs.stagehand.dev/v2/references/stagehand.md): Complete API reference for initializing Stagehand - [act()](https://docs.stagehand.dev/v2/references/act.md): Complete API reference for the act() method - [extract()](https://docs.stagehand.dev/v2/references/extract.md): Complete API reference for the extract() method - [observe()](https://docs.stagehand.dev/v2/references/observe.md): Complete API reference for the observe() method - [agent()](https://docs.stagehand.dev/v2/references/agent.md): Complete API reference for the agent() method - [Usecase observe](https://docs.stagehand.dev/v2/best-practices/usecase-observe.md) - [User Data Directory](https://docs.stagehand.dev/v2/best-practices/user-data.md): Persist browser data between sessions - [Usecase observe](https://docs.stagehand.dev/v3/best-practices/usecase-observe.md) - [User Data Directory](https://docs.stagehand.dev/v3/best-practices/user-data.md): Persist browser data between sessions ## OpenAPI Specs - [openapi.documented](https://app.stainless.com/api/spec/documented/stagehand/openapi.documented.yml) - [package](/package.json) ## Optional - [Discord](https://discord.gg/stagehand) - [GitHub](https://github.com/browserbase/stagehand) - [Changelog](https://github.com/browserbase/stagehand/releases)