Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Stagehand Python SDK

A Python SDK for BrowserBase Stagehand, enabling automated browser control and data extraction.

Installation

pip install stagehand-sdk

Usage

import asyncio
from stagehand import Stagehand

async def main():
    # Initialize the Stagehand client
    browser = Stagehand(
        env="BROWSERBASE",
        api_key="your-api-key",
        project_id="your-project-id"
    )
    
    # Perform browser actions
    result = await browser.act("Navigate to google.com")
    
    # Extract data using a schema
    data = await browser.extract("Get the search results", {
        "results": [{"title": "string", "url": "string"}]
    })
    
    # Close the browser
    await browser.close()

# Run the example
asyncio.run(main())

Configuration

  • env: Environment to use (default: "BROWSERBASE")
  • api_key: Your BrowserBase API key (can also be set via BROWSERBASE_API_KEY environment variable)
  • project_id: Your BrowserBase project ID (can also be set via BROWSERBASE_PROJECT_ID environment variable)
  • verbose: Verbosity level (default: 0)

Features

  • Automated browser control with natural language commands
  • Data extraction with schema validation
  • Async/await support
  • Automatic NextJS server management

Requirements

  • Python 3.7+
  • httpx
  • asyncio

License

MIT License

Metadata

Release files for stagehand-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stagehand-sdk 0.1.0
File Size Uploaded
stagehand_sdk-0.1.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stagehand-sdk 0.1.0
File Interpreter ABI Platform
stagehand_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / stagehand_sdk-0.1.0.tar.gz

Download URL stagehand_sdk-0.1.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5e3631b089170a2e3c8309a0d68202449415be449b6b93c428b60ac9b4ed22bc
BLAKE2b-256 checksum
How to use checksums
a0a49ce518ad74e02952301696d1a39bc45a34b5babc0820e24ffb2454f581dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.9

Release files / stagehand_sdk-0.1.0-py3-none-any.whl

Download URL stagehand_sdk-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef88542bac541f0f295a1cb277bea4c7b285d0ad4503cd7e98fd38e7c8a7de79
BLAKE2b-256 checksum
How to use checksums
6e18ef04534d2329b5a4ffdc9f1826c249411e89c2c921feab1fc4a4483cba20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page