Stagehand is an AI web browsing framework, fully compatible with Playwright
Get your Browserbase API Key and Project ID
Your API key and Project ID are displayed in the Overview Dashboard:
Then copy your API Key directly from the input and update your .env
by adding the BROWSERBASE_API_KEY
and BROWSERBASE_PROJECT_ID
entries.
Get your OpenAI/Anthropic API Key
You can get your OpenAI/Anthropic API Key from the OpenAI Dashboard or Anthropic Dashboard.
Install Stagehand
Update your code or clone a template
Integrating Stagehand into your existing code is straightforward:
BROWSERBASE_API_KEY
, BROWSERBASE_PROJECT_ID
, and OPENAI_API_KEY
environment variables to the values you copied.BROWSERBASE_API_KEY
, BROWSERBASE_PROJECT_ID
, and OPENAI_API_KEY
environment variables to the values you copied.Inspect the completed Session
You can find all the recent sessions on the Overview Dashboard, along with essential metrics:
Select your Session to inspect it with the Session Inspector.
Learn how to connect to and interact with browser sessions effectively.
Understand how to properly end sessions and manage their lifecycle.