# Quickstart

#### Prepare the environment <a href="#prepare-the-environment" id="prepare-the-environment"></a>

Scrap Web requires Python 3.11 or higher.

First, we recommend using [uv](https://docs.astral.sh/uv/) to setup the Python environment.

Copy

```
uv venv --python 3.11
```

and activate it with:

Copy

```
source .venv/bin/activate
```

Install the dependencies:

Copy

```
uv pip install scrap-web
```

Then install playwright:

Copy

```
playwright install
```

#### [​](https://docs.browser-use.com/quickstart#create-an-agent)Create an agent <a href="#create-an-agent" id="create-an-agent"></a>

Then you can use the agent as follows:

agent.pyCopy

```
from langchain_openai import ChatOpenAI
from swift_web import Agent
import asyncio

llm = ChatOpenAI(model="gpt-4o")

async def main():
    agent = Agent(
        task="Find a one-way flight from Bali to Oman on 12 January 2025 on Google Flights. Return me the cheapest option.",
        llm=llm,
    )
    result = await agent.run()
    print(result)

asyncio.run(main())
```

[**​**](https://docs.browser-use.com/quickstart#set-up-your-llm-api-keys)**Set up your LLM API keys**

`ChatOpenAI` and other Langchain chat models require specific API keys. For example, for for OpenAI and Anthropic, you can set the API keys in your `.env` file, such as.

.envCopy

```
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
```

For other LLM models you can refer to the [Langchain documentation](https://python.langchain.com/docs/integrations/chat/) to find how to set them up with their specific API keys.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://scrap-web.gitbook.io/scrap-web/get-started/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
