Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

edit-quickstart-docs

Magnus Müller3b6035d82137
diff --git a/.env2 b/.env2
new file mode 100644
index 000000000..e69de29bb
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx
index cb8725833..e4a072bc3 100644
--- a/docs/quickstart.mdx
+++ b/docs/quickstart.mdx
@@ -5,45 +5,109 @@ icon: "rocket"
---
-## 1. Easy setup
-
-Use [uv](https://docs.astral.sh/uv/) to create and activate the environment:
+## 1. Fast setup
+<Tabs>
+<Tab title="uv">
```bash
uv venv --python 3.12
```
+</Tab>
+<Tab title="pip">
+```bash
+python -m venv .venv
+```
+</Tab>
+</Tabs>
+<Tabs>
+<Tab title="Mac/Linux">
```bash
-# For Mac/Linux:
source .venv/bin/activate
-
-# For Windows:
+```
+</Tab>
+<Tab title="Windows">
+```bash
.venv\Scripts\activate
```
+</Tab>
+</Tabs>
-Install browser-use:
+Install browser-use & chromium:
+<Tabs>
+<Tab title="uv">
```bash
uv pip install browser-use
+uvx playwright install chromium --with-deps
```
-
-Install Chromium:
-
+</Tab>
+<Tab title="pip">
```bash
-uvx playwright install chromium --with-deps
+pip install browser-use
+playwright install chromium --with-deps
```
+</Tab>
+</Tabs>
## 2. Choose your favorite LLM
-Create a `.env` file and add your API key:
+Create a `.env` file and add your API key. Don't have one? Start with a [free Gemini key](https://aistudio.google.com/app/u/1/apikey?pli=1).
+
+<Tabs>
+<Tab title="Mac/Linux">
+```bash
+touch .env
+```
+</Tab>
+<Tab title="Windows">
+```cmd
+echo. > .env
+```
+</Tab>
+</Tabs>
+<Tabs>
+<Tab title="Google">
+```bash .env
+GEMINI_API_KEY=
+```
+</Tab>
+<Tab title="OpenAI">
```bash .env
OPENAI_API_KEY=
```
+</Tab>
+<Tab title="Anthropic">
+```bash .env
+ANTHROPIC_API_KEY=
+```
+</Tab>
+</Tabs>
-See [Supported Models](/customize/supported-models) for other models.
+See [Supported Models](/customize/supported-models) for more.
## 3. Run your first agent
+<Tabs>
+<Tab title="Google">
+```python agent.py
+from browser_use import Agent, ChatGoogle
+from dotenv import load_dotenv
+import asyncio
+
+load_dotenv()
+
+async def main():
+ llm = ChatGoogle(model="gemini-2.5-flash")
+ task = "Find the number 1 post on Show HN"
+ agent = Agent(task=task, llm=llm)
+ await agent.run()
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+</Tab>
+<Tab title="OpenAI">
```python agent.py
from browser_use import Agent, ChatOpenAI
from dotenv import load_dotenv
@@ -52,7 +116,25 @@ import asyncio
load_dotenv()
async def main():
- llm = ChatOpenAI(model="gpt-4.1-mini")
+ llm = ChatOpenAI(model="gpt-4o")
+ task = "Find the number 1 post on Show HN"
+ agent = Agent(task=task, llm=llm)
+ await agent.run()
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+</Tab>
+<Tab title="Anthropic">
+```python agent.py
+from browser_use import Agent, ChatAnthropic
+from dotenv import load_dotenv
+import asyncio
+
+load_dotenv()
+
+async def main():
+ llm = ChatAnthropic(model="claude-3-5-sonnet-20241022")
task = "Find the number 1 post on Show HN"
agent = Agent(task=task, llm=llm)
await agent.run()
@@ -60,3 +142,5 @@ async def main():
if __name__ == "__main__":
asyncio.run(main())
```
+</Tab>
+</Tabs>