close
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Stagehand + Browserbase: Business Lookup with Agent

AT A GLANCE

  • Goal: Automate business registry searches using an autonomous AI agent with computer-use capabilities.
  • Uses Stagehand Agent in CUA mode to navigate complex UI elements, apply filters, and extract structured business data.
  • Demonstrates extraction with Pydantic schema validation for consistent data retrieval.
  • Docs → https://docs.stagehand.dev/basics/agent

GLOSSARY

QUICKSTART

  1. uv venv venv
  2. source venv/bin/activate # On Windows: venv\Scripts\activate
  3. uvx install stagehand python-dotenv pydantic
  4. cp .env.example .env # Add required API keys/IDs to .env
  5. python main.py

EXPECTED OUTPUT

  • Initializes Stagehand session with Browserbase
  • Displays live session link for monitoring
  • Navigates to SF Business Registry search page
  • Agent searches for business using DBA Name filter
  • Agent completes search and opens business details
  • Extracts structured business information (DBA Name, Account Number, NAICS Code, etc.)
  • Outputs extracted data as JSON
  • Closes session cleanly

COMMON PITFALLS

  • "ModuleNotFoundError": ensure all dependencies are installed via pip
  • Missing credentials: verify .env contains BROWSERBASE_API_KEY and GOOGLE_API_KEY
  • Google API access: ensure you have access to Google's gemini-2.5-computer-use-preview-10-2025 model
  • Agent failures: check that the business name exists in the registry and that max_steps is sufficient for complex searches
  • Import errors: activate your virtual environment if you created one
  • Find more information on your Browserbase dashboard -> https://www.browserbase.com/sign-in

USE CASES

• Business verification: Automate registration status checks, license validation, and compliance verification for multiple businesses. • Data enrichment: Collect structured business metadata (NAICS codes, addresses, ownership) for research or CRM updates. • Due diligence: Streamline background checks by autonomously searching and extracting business registration details from public registries.

NEXT STEPS

• Parameterize search: Accept business names as command-line arguments or from a CSV file for batch processing. • Expand extraction: Add support for additional fields like tax status, licenses, or historical registration changes. • Multi-registry support: Extend agent to search across multiple city or state business registries with routing logic.

HELPFUL RESOURCES

📚 Stagehand Docs: https://docs.stagehand.dev/v3/first-steps/introduction 🎮 Browserbase: https://www.browserbase.com 💡 Try it out: https://www.browserbase.com/playground 🔧 Templates: https://www.browserbase.com/templates 📧 Need help? support@browserbase.com 💬 Discord: http://stagehand.dev/discord