# Browser Use Apify (`lexis-solutions/browser-use-apify`) Actor

Open-source AI-powered browser automation based on Browser Use and hosted on Apify. Run any task using Apify's platform and LLMs like ChatGPT, Claude, etc. Easy, scalable, resilient, and hosted solution for web-enabled AI agents.

- **URL**: https://apify.com/lexis-solutions/browser-use-apify.md
- **Developed by:** [Lexis Solutions](https://apify.com/lexis-solutions) (community)
- **Categories:** AI, Automation
- **Stats:** 391 total users, 3 monthly users, 100.0% runs succeeded, 48 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Make Websites Accessible for Agents using Browser-Use, hosted on Apify.

![Browser-Use Apify](https://github.com/browser-use/browser-use/raw/main/static/browser-use.png)

### What is Browser-Use?

Browser-Use is a tool that allows you to interact with websites using natural language.

### How does it work?

![Browser-Use Apify](https://lexis-solutions-apify.fra1.cdn.digitaloceanspaces.com/banners/browser-use-agent-history.gif)

Browser Use combines advanced AI capabilities with robust browser automation to make web interactions seamless for AI agents.

More details on the [Browser-Use](https://github.com/browser-use/browser-use) project.

### Why use Browser-Use Apify

- Hosted on Apify, so you can run it on a large scale.
- No need to install Playwright or other browser automation tools.
- Hosted solution, so you don't need to worry about maintaining the infrastructure.

### How to use

1. Go to the [Apify Console](https://console.apify.com/actors/browser-use-apify)
2. Click on the "Run" button
3. Enter the task you want to perform
4. Click on the "Run" button

### Input

| Name          | Type      | Description                                                                 |
| ------------- | --------- | --------------------------------------------------------------------------- |
| `task`        | `string`  | The task to perform.                                                        |
| `llmProvider` | `string`  | The LLM provider to use. Supported providers include: OpenAI and Anthropic. |
| `model`       | `string`  | The model to use.                                                           |
| `apiKey`      | `string`  | The API key to use.                                                         |
| `openaiBaseUrl` | `string` | Optional. OpenAI-compatible API base URL (OpenAI provider only). Use for Azure OpenAI, LiteLLM, or other OpenAI-compatible endpoints. |
| `useVision`   | `boolean` | Whether to use vision.                                                      |

### Example

```json
{
  "task": "Go to the Apify Store. In the search type 'Lexis Solutions', hit enter. Then get the count of actors in the results.",
  "llmProvider": "anthropic",
  "model": "claude-3-5-sonnet-20241022",
  "apiKey": "...",
  "useVision": true
}
```

OpenAI-compatible endpoint (e.g. custom proxy or Azure):

```json
{
  "task": "Go to example.com and read the page title.",
  "llmProvider": "openai",
  "model": "gpt-4o",
  "apiKey": "...",
  "openaiBaseUrl": "https://your-openai-compatible-host/v1",
  "useVision": true
}
```

### Output

The output is a JSON object with the result of the task.

```json
{
  "result": "The count of results in the first page is 10."
}
```

### More info and debugging

The actor also saves information in the key-value store, which you can use to debug the task.

- `visited_urls`: The URLs visited by the agent.
- `action_names`: The names of the actions performed by the agent.
- `errors`: The errors encountered by the agent.
- `model_actions`: The actions performed by the model.
- `model_thoughts`: The thoughts of the model.
- `agent_history.gif`: The history of the agent as a GIF.

### Resources

- [Browser-Use](https://docs.browser-use.com/)
- [Apify](https://apify.com)
- [Apify Actor](https://docs.apify.com/actor)

***

Got feedback or need an extension?

Lexis Solutions is a [certified Apify Partner](https://apify.com/partners). We can help you with custom solutions or data extraction projects.

Contact us from our website [Lexis Solutions](https://lexis.solutions) or [LinkedIn](https://www.linkedin.com/company/lexis-solutions)

Image Credit: Browser-Use

# Actor input Schema

## `task` (type: `string`):

Task to perform

## `llmProvider` (type: `string`):

LLM provider to use. Supported providers include: OpenAI and Anthropic.

## `model` (type: `string`):

Model to use.

## `apiKey` (type: `string`):

Your LLM API key

## `openaiBaseUrl` (type: `string`):

Optional. Base URL for an OpenAI-compatible API (e.g. Azure OpenAI, LiteLLM, or a local proxy). Used only when LLM Provider is OpenAI. Example: https://api.openai.com/v1

## `useVision` (type: `boolean`):

Whether to use vision to perform the task.

## Actor input object example

```json
{
  "llmProvider": "openai",
  "model": "gpt-4o",
  "useVision": true
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "llmProvider": "openai",
    "model": "gpt-4o"
};

// Run the Actor and wait for it to finish
const run = await client.actor("lexis-solutions/browser-use-apify").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "llmProvider": "openai",
    "model": "gpt-4o",
}

# Run the Actor and wait for it to finish
run = client.actor("lexis-solutions/browser-use-apify").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "llmProvider": "openai",
  "model": "gpt-4o"
}' |
apify call lexis-solutions/browser-use-apify --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lexis-solutions/browser-use-apify"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6GzGx1kHBFQvgBvzt/builds/nem4Ly4P6a5BXTpHT/openapi.json
