Stagehand

Stagehand runs browser automation using Browserbase and an LLM. Use Extract to retrieve page data matching a schema. Use Agent for a task that requires multiple browser interactions, such as navigating and filling out a form. Configure the Browserbase and model credentials required by the selected operation.

Usage Instructions

Integrate Stagehand into the workflow. Can extract structured data from webpages or run an autonomous agent to perform tasks.

Actions

Stagehand Extract

Extract structured data from a webpage using Stagehand

Input

ParameterTypeRequiredDescription
urlstringYesURL of the webpage to extract data from
instructionstringYesInstructions for extraction
providerstringNoAI provider to use: openai or anthropic
apiKeystringYesAPI key for the selected provider
schemajsonYesJSON schema defining the structure of the data to extract

Output

ParameterTypeDescription
dataobjectExtracted structured data matching the provided schema

Stagehand Agent

Run an autonomous web agent to complete tasks and extract structured data

Input

ParameterTypeRequiredDescription
startUrlstringYesURL of the webpage to start the agent on
taskstringYesThe task to complete or goal to achieve on the website
variablesjsonNoOptional variables to substitute in the task (format: {key: value}). Reference in task using %key%
providerstringNoAI provider to use: openai or anthropic
apiKeystringYesAPI key for the selected provider
outputSchemajsonNoOptional JSON schema defining the structure of data the agent should return
modestringNoAgent tool mode: dom (default), hybrid, or cua
maxStepsnumberNoMaximum agent steps (default 20, max 200)

Output

ParameterTypeDescription
agentResultobjectResult from the Stagehand agent execution
successbooleanWhether the agent task completed successfully without errors
completedbooleanWhether the agent finished executing (may be false if max steps reached)
messagestringFinal status message or result summary from the agent
actionsarrayList of all actions performed by the agent during task execution
typestringType of action performed (e.g., "act", "observe", "ariaTree", "close", "wait", "navigate")
reasoningstringAI reasoning for why this action was taken
taskCompletedbooleanWhether the task was completed after this action
actionstringDescription of the action taken (e.g., "click the submit button")
instructionstringInstruction that triggered this action
pageUrlstringURL of the page when this action was performed
pageTextstringPage text content (for ariaTree actions)
timestampnumberUnix timestamp when the action was performed
timeMsnumberTime in milliseconds (for wait actions)
structuredOutputobjectExtracted data matching the provided output schema
liveViewUrlstringEmbeddable Browserbase live view URL (active only while the session is running)
sessionIdstringBrowserbase session identifier