# 🤘 Stagehand ## Docs - [End a browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Execute an AI agent](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [Extract data from the page](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Navigate to a URL](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Observe available actions](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Perform an action](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/go/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Start a new browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/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. - [End a browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Execute an AI agent](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [Extract data from the page](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Navigate to a URL](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Observe available actions](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Perform an action](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/java/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Start a new browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/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. - [End a browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Execute an AI agent](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [Extract data from the page](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Navigate to a URL](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Observe available actions](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Perform an action](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/python/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Start a new browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/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. - [End a browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/end-a-browser-session.md): Terminates the browser session and releases all associated resources. - [Execute an AI agent](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/execute-an-ai-agent.md): Runs an autonomous AI agent that can perform complex multi-step browser tasks. - [Extract data from the page](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/extract-data-from-the-page.md): Extracts structured data from the current page using AI-powered analysis. - [Navigate to a URL](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/navigate-to-a-url.md): Navigates the browser to the specified URL. - [Observe available actions](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/observe-available-actions.md): Identifies and returns available actions on the current page that match the given instruction. - [Perform an action](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/api-reference/ruby/perform-an-action.md): Executes a browser action using natural language instructions or a predefined Action object. - [Start a new browser session](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/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. - [Act](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/basics/act.md): Interact with a web page - [Agent](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/basics/agent.md): Automate complex workflows with AI powered browser agents - [Evaluations & Metrics](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/basics/evals.md): Monitor performance, optimize costs, and evaluate LLM effectiveness - [Extract](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/basics/extract.md): Extract structured data from a webpage - [Observe](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/basics/observe.md): Discover and plan executable actions on any web page - [Agent Fallbacks](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/agent-fallbacks.md): A failsafe when unexpected page changes add extra steps - [Caching Actions](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/caching.md): Cache actions automatically to reduce costs and improve performance - [Computer Use Agents](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/computer-use.md): Incorporate Computer Use APIs from Google, Anthropic, and OpenAI with one line of code in Stagehand. - [Cost Optimization](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/cost-optimization.md): Minimize costs while maintaining automation performance - [Deploying Stagehand](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/deployments.md): Deploy your AI agents and automations to the cloud - [Deterministic Agent Scripts](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/deterministic-agent.md): Use auto-caching to convert agent workflows into fast, deterministic scripts - [History Tracking](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/history.md): Track and analyze Stagehand operations with the history API - [MCP Integrations](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/mcp-integrations.md): Using Model Context Protocol (MCP) integrations to enhance agent capabilities - [Prompting Best Practices](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/prompting-best-practices.md): Write effective prompts for reliable Stagehand automation - [Speed Optimization](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/speed-optimization.md): Optimize Stagehand performance for faster automation and reduced latency - [Using Multiple Tabs](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/best-practices/using-multiple-tabs.md): Act on multiple tabs with Stagehand - [Browser](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/configuration/browser.md): Configure Stagehand on Browserbase or locally - [Logging](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/configuration/logging.md): Set up logging, debugging, and error tracking for Stagehand workflows - [Models](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/configuration/models.md): Use any LLM model with Stagehand for optimal performance - [Observability](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/configuration/observability.md): Track Stagehand automation with session visibility and analytics - [AI Rules](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/first-steps/ai-rules.md): Using AI to write Stagehand code faster, and better. - [Installation](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/first-steps/installation.md): Integrate Stagehand into an existing project. - [Introducing Stagehand](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/first-steps/introduction.md): Developers use Stagehand to reliably automate the web. - [Quickstart](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/first-steps/quickstart.md): Stagehand allows you to build web automations with natural language and code. - [Use CrewAI to Automate Browser Tasks](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/crew-ai/configuration.md): Create intelligent agents that can interact with websites and automate browser tasks using natural language instructions - [CrewAI Introduction](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/crew-ai/introduction.md): Automate browser tasks using natural language instructions with CrewAI - [LangChain JS Configuration](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/langchain/configuration.md): Set up Stagehand with LangChain JS to create intelligent web automation agents - [Langchain JS Introduction](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/langchain/introduction.md): Integrate Stagehand with Langchain JS for intelligent web automation - [Browserbase MCP Server Configuration](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/mcp/configuration.md): Configure your browser automation with command-line flags, environment variables, and advanced options - [Browserbase MCP Server](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/mcp/introduction.md): AI-powered browser automation through Model Context Protocol integration with Stagehand - [Browserbase MCP Server Setup](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/mcp/setup.md): Add the Browserbase MCP Server to Claude - [Browserbase MCP Server Tools](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/mcp/tools.md): This guide covers the specialized tools available in the Browserbase MCP server for browser automation and interaction. - [Playwright](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/playwright.md): Use Stagehand with Playwright for browser automation - [Puppeteer](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/puppeteer.md): Use Stagehand with Puppeteer for browser automation - [Selenium](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/selenium.md): Use Stagehand with Selenium to operate the same browser in tandem - [Use Stagehand in Next.js](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/vercel/configuration.md): Next.js is a popular framework for developing web-based applications in production. It powers Stagehand apps like [Director](https://director.ai), [Brainrot](https://brainrot.run) and [Open Operator](https://operator.browserbase.com). - [Next.js + Vercel](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/integrations/vercel/introduction.md): Build and deploy a Stagehand‑powered Next.js app to Vercel - [Migrate Python v2 to v3](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/migrations/python.md): Complete migration guide from Stagehand Python SDK v2 to the new Stainless-based v3 SDK - [Migrate TypeScript v2 to v3](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/migrations/v2.md): Complete migration guide from Stagehand TypeScript SDK v2 to v3 - [act()](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/act.md): Complete API reference for the act() method - [agent()](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/agent.md): Complete API reference for the agent() method - [context](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/context.md): Complete API reference for the browser context - [deepLocator](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/deeplocator.md): Complete API reference for the deepLocator method - [extract()](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/extract.md): Complete API reference for the extract() method - [locator](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/locator.md): Complete API reference for the Locator class - [observe()](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/observe.md): Complete API reference for the observe() method - [page](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/page.md): Complete API reference for the Stagehand Page object - [Response](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/response.md): Complete API reference for the Response object - [Stagehand](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/references/stagehand.md): Complete API reference for the Stagehand class - [Go SDK](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/sdk/go.md): Official Stagehand SDK for Go - [Java SDK](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/sdk/java.md): Official Stagehand SDK for Java - [Python SDK](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/sdk/python.md): Official Stagehand SDK for Python - [Ruby SDK](https://stagehand-shrey-check-v3-metrics-docs.mintlify.app/v3/sdk/ruby.md): Official Stagehand SDK for Ruby ## OpenAPI Specs - [openapi.documented](https://app.stainless.com/api/spec/documented/stagehand/openapi.documented.yml) ## Optional - [Discord](https://stagehand.dev/discord) - [GitHub](https://github.com/browserbase/stagehand) - [Changelog](https://github.com/browserbase/stagehand/releases)