Skip to main content

Prerequisites

Before starting, make sure you have:
  • Python 3.11 or higher installed
  • An API key from a supported LLM provider (we recommend ChatBrowserUse - new signups get $10 free credits)
Browser Use requires Python 3.11+. If you’re on an older version, upgrade first:

Installation

1

Install uv (recommended)

The fastest way to get started is with uv, a modern Python package manager:
Or on Windows:
Already have pip? Skip to the alternative installation method below.
2

Create a new project

3

Install Browser Use

We ship updates daily - always use the latest version for best results!
4

Install Chromium

Browser Use needs a Chromium browser to control:
This downloads and sets up a compatible Chromium browser automatically.

Alternative: Using pip

If you prefer using pip:

Set Up Your API Key

1

Get an API key

Sign up for a free API key from Browser Use Cloud.New signups get $10 in free credits to try ChatBrowserUse - the fastest and most accurate model for browser automation.
You can also use OpenAI, Anthropic, Google, or any other supported provider. See LLM Providers for all options.
2

Create environment file

Create a .env file in your project directory:
On Windows:
3

Add your API key

Open .env and add your key:

Your First Agent

Create a file called main.py:
main.py

Run Your Agent

You should see:
  • A browser window opening (unless you set headless=True)
  • The agent navigating to HackerNews
  • Element highlights as the agent analyzes the page
  • Console output showing the agent’s actions and reasoning
  • The final result printed at the end
First run taking long? The initial run downloads browser binaries and may take a minute. Subsequent runs are much faster!

More Examples

Example 2: Form Filling

Example 3: Data Extraction

Example 4: Structured Output

Get results as typed Python objects:

Using Templates (Fast Start)

Browser Use includes ready-to-run templates:
This creates a complete Python file you can run immediately.

Configure the Browser

Customize browser behavior:
See the Browser Configuration guide for all available options.

Using Different LLM Providers

Working with Agent History

The run() method returns an AgentHistoryList with useful information:

Deploy to Production

The easiest way to run Browser Use in production is with the @sandbox decorator:
This handles:
  • ✅ Browser provisioning and management
  • ✅ Automatic scaling
  • ✅ Session persistence
  • ✅ Authentication handling
See Going to Production for advanced deployment options including authentication, proxies, and stealth mode.

Troubleshooting

Browser doesn’t open

Make sure Chromium is installed:

Import errors

Ensure you’re using Python 3.11+:

API key not found

Check that your .env file is in the same directory as your script and properly formatted:

Slow performance

For faster execution:
  1. Use ChatBrowserUse (3-5x faster than other models)
  2. Enable flash_mode=True for simple tasks
  3. Use Browser Use Cloud with use_cloud=True

Next Steps

Installation Details

Learn about advanced installation options

Browser Configuration

Customize browser behavior and settings

Custom Tools

Extend agents with custom Python functions

Production Deployment

Deploy to production with sandboxes

100+ Examples

Explore real-world use cases

Discord Community

Join 20k+ developers
Need help? Join our Discord community with 20,000+ developers ready to help!