A hosted API server for AI agents to control web browsers in the cloud using Browserbase, Stagehand, and Playwright.
This server provides a REST API for AI agents to:
- Create and manage browser sessions in the cloud
- Control browsers using natural language commands
- Extract structured data from web pages
- Monitor browser activity and errors
- Take screenshots and inspect DOM state
- Execute custom Playwright automation scripts
Built on top of:
- Browserbase for cloud browser infrastructure
- Stagehand for AI-powered browser control
- Playwright for low-level browser automation
- Express.js for the API server
For complete API documentation, visit wbac-api-docs.netlify.app
POST /api/sessions/create-session
- Create new browser sessionPOST /api/sessions/stop-session/:sessionId
- Stop sessionGET /api/sessions/running-sessions
- List active sessionsGET /api/sessions/session/:sessionId
- Get session informationGET /api/sessions/debug/:sessionId
- Get session debug URLs
POST /api/browser/navigate/:sessionId
- Navigate to URLPOST /api/browser/act/:sessionId
- Perform action via natural languagePOST /api/browser/extract/:sessionId
- Extract structured dataPOST /api/browser/observe/:sessionId
- Get possible actions
GET /api/browser/console-logs/:sessionId
- Get console logsGET /api/browser/network-logs/:sessionId
- Get network logsGET /api/browser/dom-state/:sessionId
- Get DOM statePOST /api/browser/screenshot/:sessionId
- Take screenshotPOST /api/browser/clear-logs/:sessionId
- Clear logs
- Create new browser sessions
- Resume existing sessions
- List running sessions
- Stop/cleanup sessions
- Natural language actions via
act()
- Structured data extraction via
extract()
- Page observation via
observe()
- Vision-based interaction support
- Console log monitoring
- Network request/response logging
- Error tracking
- Screenshot capture
- DOM state inspection
- Node.js 16+
- Browserbase account and credentials
- OpenAI or Anthropic API key for AI features
git clone https://github.com/kortix-ai/wbac
cd wbac
npm i
Create a .env
file with:
BROWSERBASE_API_KEY=your_api_key
BROWSERBASE_PROJECT_ID=your_project_id
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
npm start
A Streamlit-based UI is included for testing and debugging:
pip install streamlit
streamlit run streamlit_ui.py
- AI agents that need web browsing capabilities
- Automated web testing with AI assistance
- Web scraping with natural language commands
- Browser automation monitoring and debugging
Contributions welcome! Please read our contributing guidelines and submit pull requests.
MIT License - see LICENSE file for details
- Browserbase for cloud browser infrastructure
- Stagehand for AI browser control capabilities
- Playwright for powerful browser automation