> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.multion.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.multion.ai/_mcp/server.

# Browse

POST https://api.multion.ai/v1/web/browse
Content-Type: application/json

Allows for browsing the web using detailed natural language commands.

The function supports multi-step command execution based on the `CONTINUE` status of the Agent.

Reference: https://docs.multion.ai/api-reference/autonomous-api-reference/browse

## Authentication

- `X_MULTION_API_KEY` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects an object.

- `cmd` (string, required) — A specific natural language instruction for the agent to execute
- `url` (string, optional) — The URL to start or continue browsing from. (Default: google.com)
- `local` (boolean, optional) — Boolean flag to indicate if session to be run locally or in the cloud (Default: False). If set to true, the session will be run locally via your chrome extension. If set to false, the session will be run in the cloud.
- `session_id` (string, optional) — Continues the session with session_id if provided.
- `max_steps` (integer, optional, default: 20) — Maximum number of steps to execute. (Default: 20)
- `include_screenshot` (boolean, optional) — Boolean flag to include a screenshot of the final page. (Default: False)
- `temperature` (double, optional) — The temperature of model
- `agent_id` (string, optional) — The agent id to use for the session.
- `mode` (enum, optional) — The mode you would like to use for the session. 'fast' or 'standard'
  - Allowed values: `fast`, `standard`
- `use_proxy` (boolean, optional) — Boolean flag to use a proxy for the session (Default: False). Each Session gets a new Residential IP.

## Response

### 200

- `message` (string, required) — The final message or result of the browsing session.
- `status` (string, required) — The final status of the browsing session. One of ["CONTINUE", "ASK_USER", "DONE"]
- `url` (string, required) — The current URL of the session.
- `screenshot` (string, required) — image url of the screenshot taken during the session.
- `session_id` (string, required) — The unique identifier for the session.
- `metadata` (Metadata, optional) — Additional metadata for the session

## Errors

### 400 Bad Request

Bad Request

- `statusCode` (integer, optional)
- `error` (string, optional)
- `message` (string, optional)

### 401 Unauthorized

Unauthorized

- `statusCode` (integer, optional)
- `error` (string, optional)
- `message` (string, optional)

### 402 Payment Required

Payment Required

- `statusCode` (integer, optional)
- `error` (string, optional)
- `message` (string, optional)

### 422 Unprocessable Entity

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Internal Server Error

- `statusCode` (integer, optional)
- `error` (string, optional)
- `message` (string, optional)

## Types

### Metadata

Additional metadata for the session

- `step_count` (integer, optional) — Number of steps executed to complete browse request.
- `processing_time` (integer, optional) — Time taken to process the request in seconds.
- `temperature` (double, optional) — The temperature of model

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

**Request**

```json
{
  "cmd": "Find the top post on Hackernews.",
  "url": "https://news.ycombinator.com/"
}
```

**Response**

```json
{
  "message": "Memorizing the following information: The top post on Hacker News is \"Show HN: Sonauto – a more controllable AI music creator\" with 219 points.\n",
  "status": "DONE",
  "url": "https://news.ycombinator.com/",
  "screenshot": "https://api.multion.ai/v1/web/screenshot/1",
  "session_id": "1",
  "metadata": {
    "step_count": 1,
    "processing_time": 10,
    "temperature": 0.2
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.multion.ai/v1/web/browse"

payload = {
    "cmd": "Find the top post on Hackernews.",
    "url": "https://news.ycombinator.com/"
}
headers = {
    "X_MULTION_API_KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript
import { MultiOnClient } from "multion";

const client = new MultiOnClient({ apiKey: "YOUR_API_KEY" });
await client.browse({
    cmd: "Find the top post on Hackernews.",
    url: "https://news.ycombinator.com/"
});

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.multion.ai/v1/web/browse"

	payload := strings.NewReader("{\n  \"cmd\": \"Find the top post on Hackernews.\",\n  \"url\": \"https://news.ycombinator.com/\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X_MULTION_API_KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.multion.ai/v1/web/browse")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X_MULTION_API_KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cmd\": \"Find the top post on Hackernews.\",\n  \"url\": \"https://news.ycombinator.com/\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.multion.ai/v1/web/browse")
  .header("X_MULTION_API_KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cmd\": \"Find the top post on Hackernews.\",\n  \"url\": \"https://news.ycombinator.com/\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.multion.ai/v1/web/browse', [
  'body' => '{
  "cmd": "Find the top post on Hackernews.",
  "url": "https://news.ycombinator.com/"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X_MULTION_API_KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.multion.ai/v1/web/browse");
var request = new RestRequest(Method.POST);
request.AddHeader("X_MULTION_API_KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cmd\": \"Find the top post on Hackernews.\",\n  \"url\": \"https://news.ycombinator.com/\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X_MULTION_API_KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "cmd": "Find the top post on Hackernews.",
  "url": "https://news.ycombinator.com/"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.multion.ai/v1/web/browse")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```