examples/cloud/README.md
Welcome to the Browser Use Cloud examples! This folder contains progressively complex examples to help you get started with the Browser Use Cloud API quickly and efficiently.
# Create virtual environment and install dependencies (from project root)
uv venv --python 3.11
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync
# Set environment variables
export BROWSER_USE_API_KEY="your_api_key_here"
export BROWSER_USE_BASE_URL="https://api.browser-use.com/api/v1" # Optional
export BROWSER_USE_TIMEOUT="30" # Optional: request timeout in seconds
# Or use .env file (recommended)
cp examples/cloud/env.example .env
# Edit .env with your values
# Run examples from project root
python examples/cloud/01_basic_task.py
For maximum speed and cost efficiency:
{
"llm_model": "gemini-2.5-flash",
"use_proxy": False,
"highlight_elements": False,
"use_adblock": True,
"max_agent_steps": 50
}
{
"use_proxy": True,
"proxy_country_code": "us", # 'us', 'fr', 'it', 'jp', 'au', 'de', 'fi', 'ca'
}
{
"secrets": {
"username": "your_username",
"password": "your_password",
"api_key": "your_api_key"
},
"allowed_domains": ["*.yoursite.com"] # Recommended with secrets
}
The Search API extracts content by actually browsing websites (not cached results):
# Cost: 1ยข ร depth ร websites
{
"query": "latest AI news",
"max_websites": 5,
"depth": 2
}
# Cost: 1ยข ร depth
{
"url": "https://example.com",
"query": "pricing information",
"depth": 3
}
Need help?
๐ก Pro Tip: Start with 01_basic_task.py and work your way up. Each example builds on the previous ones!