Skip to content

Install

Prerequisites

  • Python 3.11 or 3.12 (3.12 recommended)
  • uv package manager (strongly recommended; faster than pip)
  • A Browser Use API key from cloud.browser-use.com/new-api-key (includes 5 free tasks)

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 install

Install with pip (alternative)

bash
pip install "browser-use[core]"

Then install Playwright browsers:

bash
python -m playwright install chromium

Scaffold a starter project (optional)

Browser Use ships a project initializer:

bash
uvx browser-use init --template default

This 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_here

The library reads this automatically via python-dotenv. You can also export it:

bash
export BROWSER_USE_API_KEY=your_key_here

Install 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   # TypeScript

Cloud SDK docs: https://docs.browser-use.com/cloud/quickstart