Appearance
Install
Prerequisites
- Python 3.11 or 3.12 (3.12 recommended)
uvpackage manager (strongly recommended; faster than pip)- A Browser Use API key from cloud.browser-use.com/new-api-key (includes 5 free tasks)
Install with uv (recommended)
bash
# 1. Install uv if not already installed
pip install uv
# 2. Create a virtual environment with Python 3.12
uv venv --python 3.12
# 3. Activate it
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
# 4. Install browser-use
uv pip install browser-use
# 5. Install the Playwright browser binaries
uvx browser-use installInstall with pip (alternative)
bash
pip install "browser-use[core]"Then install Playwright browsers:
bash
python -m playwright install chromiumScaffold a starter project (optional)
Browser Use ships a project initializer:
bash
uvx browser-use init --template defaultThis generates a ready-to-run project with a .env template, main.py quickstart, and requirements.txt.
More examples: https://docs.browser-use.com/examples
Configure your API key
Create a .env file in your project root:
bash
BROWSER_USE_API_KEY=your_key_hereThe library reads this automatically via python-dotenv. You can also export it:
bash
export BROWSER_USE_API_KEY=your_key_hereInstall the cloud SDK (alternative to local)
If you want to call the cloud API directly without running a local browser:
bash
pip install browser-use-sdk
# or
npm install browser-use-sdk # TypeScriptCloud SDK docs: https://docs.browser-use.com/cloud/quickstart