Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Updated API docs and moved to newer mintlify version
Saurav Pandae0add9ce8f8d
diff --git a/.gitignore b/.gitignoreindex 4acad76e6..bab0e6265 100644--- a/.gitignore+++ b/.gitignore@@ -51,3 +51,5 @@ tmp# Google API credentialscredentials.jsontoken.json++!docs/docs.jsondiff --git a/docs/api-reference/check-balance.mdx b/docs/api-reference/check-balance.mdxnew file mode 100644index 000000000..4b1050059--- /dev/null+++ b/docs/api-reference/check-balance.mdx@@ -0,0 +1,60 @@+---+title: "Check Balance"+api: "GET /api/v1/balance"+description: "Returns the user's current API credit balance"+---++Returns the user's current API credit balance, which includes both monthly subscription credits and any additional purchased credits.++## Response++<ResponseField name="balance" type="string">+ The current number of API credits available, with the value in cents (0.01 USD = 1 credit).+</ResponseField>++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++response = requests.get(f'{BASE_URL}/balance', headers=HEADERS)+balance = response.json()['balance']+print(f"Current API credit balance: {balance}")+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/balance \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "balance": "5000"+}+```++</ResponseExample>++## API Credit Usage++Each task execution consumes API credits based on the following factors:++1. **Task Duration**: Longer running tasks consume more credits+2. **LLM Model**: More powerful models consume more credits+3. **Browser Features**: Features like proxy usage and adblock may affect credit consumption+4. **Task Complexity**: More complex tasks with many steps consume more credits++You can monitor your credit usage through the [Browser Use Cloud dashboard](https://cloud.browser-use.com/dashboard) or by using the Check Balance endpoint.++<Note>+If your balance reaches zero, new task executions will be rejected until you add more credits or your subscription renews.+</Note>diff --git a/docs/api-reference/create-scheduled-task.mdx b/docs/api-reference/create-scheduled-task.mdxnew file mode 100644index 000000000..27f089d99--- /dev/null+++ b/docs/api-reference/create-scheduled-task.mdx@@ -0,0 +1,134 @@+---+title: "Create Scheduled Task"+api: "POST /api/v1/scheduled-task"+description: "Create a new scheduled task to run at regular intervals or based on a cron expression"+---++Creates a new scheduled task to run at regular intervals or based on a cron expression. This allows you to automate recurring browser automation tasks.++<Note>+This endpoint requires an active subscription.+</Note>++## Request Body++<ParamField body="task" type="string" required>+ Instructions for what the agent should do+</ParamField>+<ParamField body="schedule_type" type="string" required>+ Type of schedule: "interval" or "cron"+</ParamField>+<ParamField body="interval_minutes" type="integer">+ Minutes between runs (required for interval schedule)+</ParamField>+<ParamField body="cron_expression" type="string">+ Cron expression for scheduling (required for cron schedule)+</ParamField>+<ParamField body="start_at" type="string">+ When to start the schedule (ISO 8601 format, defaults to now)+</ParamField>+<ParamField body="end_at" type="string">+ When to end the schedule (ISO 8601 format, defaults to 1 year from now)+</ParamField>+<ParamField body="secrets" type="object">+ Dictionary of secrets to be used by the agent (safely encrypted before storing)+</ParamField>+<ParamField body="allowed_domains" type="array">+ List of domains the agent is allowed to visit+</ParamField>+<ParamField body="save_browser_data" type="boolean" default="false">+ Whether to save browser cookies and data between runs+</ParamField>+<ParamField body="structured_output_json" type="string">+ JSON schema for structured output+</ParamField>+<ParamField body="llm_model" type="string" default="gpt-4o">+ LLM model to use. Available options: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o4-mini, o3, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash-preview-04-17, gemini-2.5-flash, gemini-2.5-pro, claude-3-7-sonnet-20250219, claude-sonnet-4-20250514, llama-4-maverick-17b-128e-instruct+</ParamField>+<ParamField body="use_adblock" type="boolean" default="true">+ Whether to use an adblocker+</ParamField>+<ParamField body="use_proxy" type="boolean" default="true">+ Whether to use a proxy+</ParamField>+<ParamField body="proxy_country_code" type="string" default="us">+ Country code for residential proxy. Must be one of: us, uk, fr, it, jp, au, de, fi, ca, in+</ParamField>+<ParamField body="highlight_elements" type="boolean" default="true">+ Whether to highlight elements on the page+</ParamField>+<ParamField body="included_file_names" type="array">+ File names to include in the task+</ParamField>+<ParamField body="browser_viewport_width" type="integer" default="1280">+ Width of browser viewport in pixels+</ParamField>+<ParamField body="browser_viewport_height" type="integer" default="960">+ Height of browser viewport in pixels+</ParamField>+<ParamField body="max_agent_steps" type="integer" default="75">+ Maximum number of agent steps (max: 200)+</ParamField>+<ParamField body="enable_public_share" type="boolean" default="false">+ Whether to enable public sharing of task executions+</ParamField>++*Either `interval_minutes` or `cron_expression` is required depending on the `schedule_type`.++## Response++<ResponseField name="id" type="string">+ The unique identifier for the created scheduled task.+</ResponseField>++<RequestExample>++```python python+import requests+from datetime import datetime, timedelta++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++start_time = datetime.utcnow().isoformat() + 'Z'+end_time = (datetime.utcnow() + timedelta(days=30)).isoformat() + 'Z'++task_data = {+ "task": "Visit example.com and check if the site is up",+ "schedule_type": "interval",+ "interval_minutes": 60,+ "start_at": start_time,+ "end_at": end_time,+ "use_adblock": True+}++response = requests.post(f'{BASE_URL}/scheduled-task', headers=HEADERS, json=task_data)+task_id = response.json()['id']+print(f"Scheduled task created with ID: {task_id}")+```++```bash curl+curl --request POST \+ --url https://api.browser-use.com/api/v1/scheduled-task \+ --header 'Authorization: Bearer <token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "task": "Visit example.com and check if the site is up",+ "schedule_type": "interval",+ "interval_minutes": 60,+ "use_adblock": true+ }'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "id": "scheduled_task_1234567890abcdef"+}+```++</ResponseExample>diff --git a/docs/api-reference/delete-browser-profile.mdx b/docs/api-reference/delete-browser-profile.mdxnew file mode 100644index 000000000..230b9c53e--- /dev/null+++ b/docs/api-reference/delete-browser-profile.mdx@@ -0,0 +1,64 @@+---+title: "Delete Browser Profile For User"+api: "POST /api/v1/delete-browser-profile-for-user"+description: "Deletes the browser profile for the user"+---++Deletes the browser profile for the user. This is useful when you want to start with a fresh browser state, clearing all stored cookies, sessions, and browser data.++## Response++The endpoint returns an empty response body with a 200 status code on success.++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++response = requests.post(f'{BASE_URL}/delete-browser-profile-for-user', headers=HEADERS)+if response.status_code == 200:+ print("Browser profile deleted successfully")+else:+ print(f"Error deleting browser profile: {response.status_code}")+```++```bash curl+curl --request POST \+ --url https://api.browser-use.com/api/v1/delete-browser-profile-for-user \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{}+```++</ResponseExample>++## What Gets Deleted++When you delete your browser profile, the following data is removed:++- **Cookies**: All stored cookies from previous sessions+- **Session data**: Login sessions and authentication tokens+- **Browser cache**: Cached resources and files+- **Local storage**: Any data stored in browser local storage+- **Browser history**: Previous browsing history within the automation environment++## Usage Notes++- This action affects all future tasks until you save browser data again+- Useful for testing scenarios where you need a clean browser state+- Does not affect tasks that are currently running+- Browser profile deletion is immediate and cannot be undone++<Info>+This is particularly useful when you need to test login flows or scenarios that require a fresh browser state without any cached data.+</Info>diff --git a/docs/api-reference/delete-scheduled-task.mdx b/docs/api-reference/delete-scheduled-task.mdxnew file mode 100644index 000000000..6316e0494--- /dev/null+++ b/docs/api-reference/delete-scheduled-task.mdx@@ -0,0 +1,81 @@+---+title: "Delete Scheduled Task"+api: "DELETE /api/v1/scheduled-task/{task_id}"+description: "Deletes a scheduled task"+---++Deletes a scheduled task. This will prevent any future runs of this task. Any currently running instances of this task will be allowed to complete.++## Path Parameters++<ParamField path="task_id" type="string" required>+ ID of the scheduled task to delete+</ParamField>++## Response++The endpoint returns an empty response body with a 200 status code on success.++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'scheduled_task_1234567890abcdef'++response = requests.delete(f'{BASE_URL}/scheduled-task/{task_id}', headers=HEADERS)++if response.status_code == 200:+ print("Scheduled task deleted successfully")+else:+ print(f"Error deleting scheduled task: {response.status_code}")+```++```bash curl+curl --request DELETE \+ --url https://api.browser-use.com/api/v1/scheduled-task/{task_id} \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{}+```++```json 404+{+ "detail": "Scheduled task not found"+}+```++```json 422+{+ "detail": [+ {+ "loc": ["path", "task_id"],+ "msg": "field required",+ "type": "value_error.missing"+ }+ ]+}+```++</ResponseExample>++## Usage Notes++- Deletion is permanent and cannot be undone+- Any currently running instances of this task will be allowed to complete+- Future scheduled runs will be prevented+- The task will be removed from the scheduled tasks list immediately++<Warning>+Deleting a scheduled task is irreversible. Make sure you want to permanently remove the task before proceeding.+</Warning>diff --git a/docs/api-reference/get-scheduled-task.mdx b/docs/api-reference/get-scheduled-task.mdxnew file mode 100644index 000000000..08ed7d9c5--- /dev/null+++ b/docs/api-reference/get-scheduled-task.mdx@@ -0,0 +1,131 @@+---+title: "Get Scheduled Task"+api: "GET /api/v1/scheduled-task/{task_id}"+description: "Returns detailed information about a specific scheduled task"+---++Returns detailed information about a specific scheduled task, including its schedule configuration and current status.++## Path Parameters++<ParamField path="task_id" type="string" required>+ ID of the scheduled task to retrieve+</ParamField>++## Response++<ResponseField name="id" type="string">+ The unique identifier for the scheduled task+</ResponseField>++<ResponseField name="task" type="string">+ Instructions for what the agent should do+</ResponseField>++<ResponseField name="save_browser_data" type="boolean">+ Whether to save browser cookies and data+</ResponseField>++<ResponseField name="structured_output_json" type="string">+ JSON schema for structured output+</ResponseField>++<ResponseField name="llm_model" type="string">+ LLM model to use+</ResponseField>++<ResponseField name="use_adblock" type="boolean">+ Whether to use an adblocker+</ResponseField>++<ResponseField name="use_proxy" type="boolean">+ Whether to use a proxy+</ResponseField>++<ResponseField name="highlight_elements" type="boolean">+ Whether to highlight elements on the page+</ResponseField>++<ResponseField name="schedule_type" type="string">+ Type of schedule: "interval" or "cron"+</ResponseField>++<ResponseField name="interval_minutes" type="integer">+ Minutes between runs+</ResponseField>++<ResponseField name="cron_expression" type="string">+ Cron expression for scheduling+</ResponseField>++<ResponseField name="start_at" type="string">+ When to start the schedule+</ResponseField>++<ResponseField name="next_run_at" type="string">+ When the next run is scheduled+</ResponseField>++<ResponseField name="end_at" type="string">+ When to end the schedule+</ResponseField>++<ResponseField name="is_active" type="boolean">+ Whether the scheduled task is active+</ResponseField>++<ResponseField name="created_at" type="string">+ When the scheduled task was created+</ResponseField>++<ResponseField name="updated_at" type="string">+ When the scheduled task was last updated+</ResponseField>++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/scheduled-task/{task_id}"++headers = {"Authorization": "Bearer <token>"}++response = requests.request("GET", url, headers=headers)++print(response.text)+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/scheduled-task/{task_id} \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "id": "scheduled_task_1234567890abcdef",+ "task": "Visit example.com and check if the site is up",+ "save_browser_data": false,+ "structured_output_json": null,+ "llm_model": "gpt-4o",+ "use_adblock": true,+ "use_proxy": true,+ "highlight_elements": true,+ "schedule_type": "interval",+ "interval_minutes": 60,+ "cron_expression": null,+ "start_at": "2023-01-01T00:00:00Z",+ "next_run_at": "2023-01-01T01:00:00Z",+ "end_at": "2023-12-31T23:59:59Z",+ "is_active": true,+ "created_at": "2023-01-01T00:00:00Z",+ "updated_at": "2023-01-01T00:00:00Z"+}+```++</ResponseExample>diff --git a/docs/api-reference/get-task-gif.mdx b/docs/api-reference/get-task-gif.mdxnew file mode 100644index 000000000..1e00893c6--- /dev/null+++ b/docs/api-reference/get-task-gif.mdx@@ -0,0 +1,75 @@+---+title: "Get Task GIF"+api: "GET /api/v1/task/{task_id}/gif"+description: "Get an animated GIF of the task execution"+---++Returns a GIF URL generated from the screenshots of the task execution. Only available for completed tasks that have screenshots.++<ParamField path="task_id" type="string" required>+ ID of the task to retrieve GIF for+</ParamField>++<ResponseField name="gif" type="string">+ URL to the animated GIF showing the task execution+</ResponseField>++<RequestExample>+```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'task_1234567890abcdef'+response = requests.get(f'{BASE_URL}/task/{task_id}/gif', headers=HEADERS)+gif_data = response.json()++if gif_data['gif']:+ print(f"GIF available at: {gif_data['gif']}")++ # Download the GIF+ gif_response = requests.get(gif_data['gif'])+ with open('task_execution.gif', 'wb') as f:+ f.write(gif_response.content)+else:+ print("No GIF available for this task")+```+</RequestExample>++<ResponseExample>+```json+{+ "gif": "https://media.browser-use.com/gifs/task_1234567890abcdef/execution.gif"+}+```+</ResponseExample>++## GIF Generation++The GIF is automatically generated from task screenshots:++- **Sequential frames**: Screenshots are combined in chronological order+- **Optimized timing**: Frame duration is optimized for readability+- **Compressed format**: GIFs are compressed for faster loading+- **Full viewport**: Shows the complete browser viewport for each step++## Availability++- GIFs are only available for completed tasks+- Requires at least 2 screenshots to generate a GIF+- Generation happens automatically after task completion+- Files are stored for 30 days after task completion++## Use Cases++Task GIFs are useful for:+- Visual task summaries and reports+- Debugging and troubleshooting+- Sharing task execution with team members+- Creating documentation of automated processes++<Note>+GIF generation may take a few minutes after task completion. If the GIF is not immediately available, check again after a short delay.+</Note>diff --git a/docs/api-reference/get-task-media.mdx b/docs/api-reference/get-task-media.mdxnew file mode 100644index 000000000..4e9325c1c--- /dev/null+++ b/docs/api-reference/get-task-media.mdx@@ -0,0 +1,60 @@+---+title: "Get Task Media"+api: "GET /api/v1/task/{task_id}/media"+description: "Get media files generated during task execution"+---++Returns links to any recordings or media generated during task execution, such as browser session recordings. Only available for completed tasks.++<ParamField path="task_id" type="string" required>+ ID of the task to retrieve media for+</ParamField>++<ResponseField name="recordings" type="array">+ List of recording URLs generated during task execution+</ResponseField>++<RequestExample>+```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'task_1234567890abcdef'+response = requests.get(f'{BASE_URL}/task/{task_id}/media', headers=HEADERS)+media = response.json()+print(f"Found {len(media['recordings'])} recordings")+```+</RequestExample>++<ResponseExample>+```json+{+ "recordings": [+ "https://media.browser-use.com/recordings/task_1234567890abcdef/session.mp4",+ "https://media.browser-use.com/recordings/task_1234567890abcdef/screen.webm"+ ]+}+```+</ResponseExample>++## Media Types++The following types of media files may be generated:++- **Session recordings**: Full browser session recordings in MP4 format+- **Screen recordings**: Screen capture videos in WebM format+- **Audio recordings**: Audio tracks if microphone access was used++## Availability++- Media files are only available for completed tasks+- Recordings are generated automatically during task execution+- Files are available for download for 30 days after task completion+- Media generation can be disabled in task settings to save storage++<Note>+Media files are only generated for tasks that have been configured to record sessions. This feature may not be available for all task types.+</Note>diff --git a/docs/api-reference/get-task-output-file.mdx b/docs/api-reference/get-task-output-file.mdxnew file mode 100644index 000000000..f861388f0--- /dev/null+++ b/docs/api-reference/get-task-output-file.mdx@@ -0,0 +1,63 @@+---+title: "Get Task Output File"+api: "GET /api/v1/task/{task_id}/output-file/{file_name}"+description: "Returns a presigned URL for downloading a file from the task output files"+---++Returns a presigned URL for downloading a file from the task output files. This endpoint is useful for retrieving files that were generated or modified during task execution.++## Path Parameters++<ParamField path="task_id" type="string" required>+ ID of the task+</ParamField>+<ParamField path="file_name" type="string" required>+ Name of the output file+</ParamField>++## Response++<ResponseField name="download_url" type="string">+ A presigned URL for downloading the file.+</ResponseField>++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'task_1234567890abcdef'+file_name = 'results.csv'++response = requests.get(f'{BASE_URL}/task/{task_id}/output-file/{file_name}', headers=HEADERS)+download_url = response.json()['download_url']++# Download the file+file_response = requests.get(download_url)+with open('downloaded_results.csv', 'wb') as file:+ file.write(file_response.content)++print("File downloaded successfully")+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/task/{task_id}/output-file/{file_name} \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "download_url": "https://storage.browser-use.com/output-files/task_1234567890abcdef/results.csv?signature=..."+}+```++</ResponseExample>diff --git a/docs/api-reference/get-task-screenshots.mdx b/docs/api-reference/get-task-screenshots.mdxnew file mode 100644index 000000000..1db64654c--- /dev/null+++ b/docs/api-reference/get-task-screenshots.mdx@@ -0,0 +1,74 @@+---+title: "Get Task Screenshots"+api: "GET /api/v1/task/{task_id}/screenshots"+description: "Get screenshots generated during task execution"+---++Returns any screenshot URLs generated during task execution. Screenshots are automatically captured at key moments during the automation process.++<ParamField path="task_id" type="string" required>+ ID of the task to retrieve screenshots for+</ParamField>++<ResponseField name="screenshots" type="array">+ List of screenshot URLs generated during task execution+</ResponseField>++<RequestExample>+```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'task_1234567890abcdef'+response = requests.get(f'{BASE_URL}/task/{task_id}/screenshots', headers=HEADERS)+screenshots = response.json()+print(f"Found {len(screenshots['screenshots'])} screenshots")++# Download the first screenshot+if screenshots['screenshots']:+ screenshot_url = screenshots['screenshots'][0]+ img_response = requests.get(screenshot_url)+ with open('screenshot.png', 'wb') as f:+ f.write(img_response.content)+```+</RequestExample>++<ResponseExample>+```json+{+ "screenshots": [+ "https://media.browser-use.com/screenshots/task_1234567890abcdef/step_1.png",+ "https://media.browser-use.com/screenshots/task_1234567890abcdef/step_2.png",+ "https://media.browser-use.com/screenshots/task_1234567890abcdef/step_3.png"+ ]+}+```+</ResponseExample>++## Screenshot Details++Screenshots are captured automatically during task execution:++- **Step-by-step captures**: Screenshots taken at each major step+- **Error captures**: Screenshots captured when errors occur+- **Final result**: Screenshot of the final state when task completes+- **High resolution**: Screenshots are captured at full browser resolution++## File Format++- All screenshots are saved in PNG format+- Screenshots maintain the original browser viewport dimensions+- File names include the task ID and step number for easy identification++## Availability++- Screenshots are available immediately after capture+- Files are stored for 30 days after task completion+- Screenshots can be disabled in task settings to reduce storage usage++<Note>+Screenshots are automatically generated for most tasks unless specifically disabled. The number of screenshots depends on the task complexity and duration.+</Note>diff --git a/docs/api-reference/get-task-status.mdx b/docs/api-reference/get-task-status.mdxnew file mode 100644index 000000000..04c220174--- /dev/null+++ b/docs/api-reference/get-task-status.mdx@@ -0,0 +1,85 @@+---+title: "Get Task Status"+api: "GET /api/v1/task/{task_id}/status"+description: "Get the current status of a task"+---++Returns just the current status of a task (created, running, finished, stopped, paused, or failed). This is more lightweight than the full task details endpoint.++## Path Parameters++<ParamField path="task_id" type="string" required>+ ID of the task to check status for+</ParamField>++## Response++The endpoint returns the status as a simple string value (not wrapped in an object).++<RequestExample>+```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++task_id = 'task_1234567890abcdef'+response = requests.get(f'{BASE_URL}/task/{task_id}/status', headers=HEADERS)+status = response.json()+print(f"Task status: {status}")+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/task/{task_id}/status \+ --header 'Authorization: Bearer <token>'+```+</RequestExample>++<ResponseExample>+```json 200+"finished"+```++```json 404+{+ "detail": "Task not found"+}+```++```json 422+{+ "detail": [+ {+ "loc": ["path", "task_id"],+ "msg": "field required",+ "type": "value_error.missing"+ }+ ]+}+```+</ResponseExample>++## Status Values++The status field can have one of the following values:++- `created`: Task is initialized but not yet started+- `running`: Task is currently executing+- `finished`: Task has completed successfully+- `stopped`: Task was manually stopped+- `paused`: Task execution is temporarily paused+- `failed`: Task encountered an error and could not complete++## Use Cases++This endpoint is useful for:+- Polling task status without retrieving full task details+- Lightweight status checks in monitoring applications+- Quick status verification before making other API calls+- Building real-time dashboards with minimal data transfer++<Tip>+Use this endpoint instead of the full task details endpoint when you only need to check the current status, as it's much faster and uses less bandwidth.+</Tip>diff --git a/docs/api-reference/get-task.mdx b/docs/api-reference/get-task.mdxnew file mode 100644index 000000000..a9b49adf3--- /dev/null+++ b/docs/api-reference/get-task.mdx@@ -0,0 +1,179 @@+---+title: "Get Task"+api: "GET /api/v1/task/{task_id}"+description: "Get comprehensive information about a task"+---++Returns comprehensive information about a task, including its current status, steps completed, output, and other metadata.++## Path Parameters+<ParamField path="task_id" type="string" required>+ ID of the task to retrieve+</ParamField>+++## Response++<ResponseField name="id" type="string" required>+ The unique identifier for the task+</ResponseField>++<ResponseField name="task" type="string" required>+ The original task instructions+</ResponseField>++<ResponseField name="output" type="string | null" required>+ The final output or result from the task (if completed)+</ResponseField>++<ResponseField name="status" type="enum<string>" required>+ Enumeration of possible task states.++ - created: Task is initialized but not yet started+ - running: Task is currently executing+ - finished: Task has completed successfully+ - stopped: Task was manually stopped+ - paused: Task execution is temporarily paused+ - failed: Task encountered an error and could not complete++ Available options: `created`, `running`, `finished`, `stopped`, `paused`, `failed`+</ResponseField>++<ResponseField name="created_at" type="string" required>+ ISO 8601 timestamp of when the task was created+</ResponseField>++<ResponseField name="steps" type="TaskStepResponse · object[]" required>+ List of task steps with execution details++ <Expandable title="Hide child attributes">+ <ResponseField name="id" type="string" required>+ Unique identifier for the step+ </ResponseField>+ <ResponseField name="step" type="integer" required>+ Step number in the execution sequence+ </ResponseField>+ <ResponseField name="evaluation_previous_goal" type="string" required>+ Assessment of the previous goal's completion+ </ResponseField>+ <ResponseField name="next_goal" type="string" required>+ Description of what the next step aims to achieve+ </ResponseField>+ <ResponseField name="url" type="string" required>+ URL of the page where the step was executed+ </ResponseField>+ </Expandable>+</ResponseField>++<ResponseField name="live_url" type="string | null">+ URL to view live task execution. To preview the url you can directly integrate it in `<iframe>` tag. For example:+ `<iframe src={live_url} width="600" height="450"></iframe>`+ Which will display the task execution and allows you to control the agent live. It is pure VNC implementation.+</ResponseField>++<ResponseField name="finished_at" type="string | null">+ ISO 8601 timestamp of when the task finished (if completed)+</ResponseField>++<ResponseField name="browser_data" type="object | null">+ Browser session data (if save_browser_data was enabled)++ This field is only available if save_browser_data is set to True in the request.++ <Expandable title="Hide child attributes">+ <ResponseField name="browser_data.cookies" type="Cookies · object[]" required>+ List of cookies from the browser session+ </ResponseField>+ </Expandable>+</ResponseField>++<ResponseField name="user_uploaded_files" type="string[] | null">+ List of files uploaded by the user for this task+</ResponseField>++<ResponseField name="output_files" type="string[] | null">+ List of files generated during task execution+</ResponseField>++<ResponseField name="public_share_url" type="string | null">+ Public URL for sharing the task (if public sharing was enabled)+</ResponseField>++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/task/{task_id}"++headers = {"Authorization": "Bearer <token>"}++response = requests.request("GET", url, headers=headers)++print(response.text)+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/task/{task_id} \+ --header 'Authorization: Bearer <token>'+```++```javascript javascript+const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};++fetch('https://api.browser-use.com/api/v1/task/{task_id}', options)+ .then(response => response.json())+ .then(response => console.log(response))+ .catch(err => console.error(err));+```+</RequestExample>++<ResponseExample>+ ```json 200+ {+ "id": "<string>",+ "task": "<string>",+ "live_url": "<string>",+ "output": "<string>",+ "status": "created",+ "created_at": "2023-11-07T05:31:56Z",+ "finished_at": "2023-11-07T05:31:56Z",+ "steps": [+ {+ "id": "<string>",+ "step": 123,+ "evaluation_previous_goal": "<string>",+ "next_goal": "<string>",+ "url": "<string>"+ }+ ],+ "browser_data": {+ "cookies": [+ {}+ ]+ },+ "user_uploaded_files": [+ "<string>"+ ],+ "output_files": [+ "<string>"+ ],+ "public_share_url": "<string>"+}+ ```++ ```json 422+ {+ "detail": [+ {+ "loc": [+ "<string>"+ ],+ "msg": "<string>",+ "type": "<string>"+ }+ ]+ }+ ```+</ResponseExample>diff --git a/docs/api-reference/index.mdx b/docs/api-reference/index.mdxnew file mode 100644index 000000000..e7f738270--- /dev/null+++ b/docs/api-reference/index.mdx@@ -0,0 +1,105 @@+---+title: "API Reference"+description: "Complete reference documentation for the Browser Use Cloud API"+icon: "code"+---++# Browser Use Cloud API++The Browser Use Cloud API allows you to programmatically control browser automation tasks. This API enables you to:++- Create and manage browser automation tasks+- Schedule recurring tasks+- Monitor task execution and status+- Retrieve task outputs and media+- Manage browser profiles and user data+- Upload and manage files for task execution++## Base URL++All API requests should be made to the following base URL:++```+https://api.browser-use.com+```++## Authentication++All API endpoints (except `/ping`) require authentication using a Bearer token. See the [Authentication](/api-reference/authentication) section for details.++## Rate Limits++The API is subject to rate limiting based on your subscription plan. If you exceed the rate limit, you'll receive a `429 Too Many Requests` response.++## API Endpoints++### Task Management++Core endpoints for creating and managing browser automation tasks:++- [**Run Task**](/api-reference/run-task) - `POST /api/v1/run-task` - Create a new browser automation task+- [**Get Task**](/api-reference/get-task) - `GET /api/v1/task/{task_id}` - Get comprehensive task information+- [**Get Task Status**](/api-reference/get-task-status) - `GET /api/v1/task/{task_id}/status` - Get current task status+- [**List Tasks**](/api-reference/list-tasks) - `GET /api/v1/tasks` - Get paginated list of all tasks+- [**Stop Task**](/api-reference/stop-task) - `PUT /api/v1/stop-task` - Stop a running task+- [**Pause Task**](/api-reference/pause-task) - `PUT /api/v1/pause-task` - Pause task execution+- [**Resume Task**](/api-reference/resume-task) - `PUT /api/v1/resume-task` - Resume a paused task++### Task Media & Files++Endpoints for retrieving task-generated media and files:++- [**Get Task Media**](/api-reference/get-task-media) - `GET /api/v1/task/{task_id}/media` - Get task recordings+- [**Get Task Screenshots**](/api-reference/get-task-screenshots) - `GET /api/v1/task/{task_id}/screenshots` - Get task screenshots+- [**Get Task GIF**](/api-reference/get-task-gif) - `GET /api/v1/task/{task_id}/gif` - Get animated task GIF+- [**Get Task Output File**](/api-reference/files#get-task-output-file) - `GET /api/v1/task/{task_id}/output-file/{file_name}` - Download task output files++### Scheduled Tasks++Endpoints for managing recurring browser automation tasks:++- [**Create Scheduled Task**](/api-reference/scheduled-tasks#create-scheduled-task) - `POST /api/v1/scheduled-task` - Create a new scheduled task+- [**List Scheduled Tasks**](/api-reference/scheduled-tasks#list-scheduled-tasks) - `GET /api/v1/scheduled-tasks` - Get paginated list of scheduled tasks+- [**Get Scheduled Task**](/api-reference/scheduled-tasks#get-scheduled-task) - `GET /api/v1/scheduled-task/{task_id}` - Get scheduled task details+- [**Update Scheduled Task**](/api-reference/scheduled-tasks#update-scheduled-task) - `PUT /api/v1/scheduled-task/{task_id}` - Update scheduled task+- [**Delete Scheduled Task**](/api-reference/scheduled-tasks#delete-scheduled-task) - `DELETE /api/v1/scheduled-task/{task_id}` - Delete scheduled task++### File Management++Endpoints for uploading and managing files for task execution:++- [**Upload File Presigned URL**](/api-reference/files#upload-file-presigned-url) - `POST /api/v1/uploads/presigned-url` - Get presigned URL for file upload++### User Management++Endpoints for managing your account, browser profiles, and checking credits:++- [**Check Balance**](/api-reference/user#check-balance) - `GET /api/v1/balance` - Check API credit balance+- [**Verify Authentication**](/api-reference/user#verify-authentication) - `GET /api/v1/me` - Verify API key validity+- [**Delete Browser Profile**](/api-reference/user#delete-browser-profile) - `POST /api/v1/delete-browser-profile-for-user` - Delete browser profile+- [**Ping**](/api-reference/user#ping) - `GET /api/v1/ping` - Health check endpoint++## Response Format++All responses are returned in JSON format. Successful responses will have a 2xx status code, while errors will have a 4xx or 5xx status code.++## Error Handling++The API uses standard HTTP status codes to indicate the success or failure of a request. In case of an error, the response body will contain additional information about the error. See the [Error Handling](/api-reference/errors) section for details.++## Additional Resources++- [**API Models**](/api-reference/models) - Complete reference for all data models and schemas+- [**Authentication**](/api-reference/authentication) - Learn how to authenticate API requests+- [**Rate Limits**](/api-reference/rate-limits) - Understand API rate limiting+- [**Examples**](/api-reference/examples) - Code examples and common use cases+- [**SDKs**](/api-reference/sdks) - Available SDKs and client libraries++## Getting Started++1. **Get your API key** from the [Browser Use Cloud dashboard](https://cloud.browser-use.com/settings/api-keys)+2. **Verify your authentication** using the `/api/v1/me` endpoint+3. **Create your first task** using the `/api/v1/run-task` endpoint+4. **Monitor task progress** using the `/api/v1/task/{task_id}` endpoint++For more detailed examples and tutorials, see the [Examples](/api-reference/examples) section.diff --git a/docs/api-reference/list-scheduled-tasks.mdx b/docs/api-reference/list-scheduled-tasks.mdxnew file mode 100644index 000000000..d0eec6433--- /dev/null+++ b/docs/api-reference/list-scheduled-tasks.mdx@@ -0,0 +1,145 @@+---+title: "List Scheduled Tasks"+api: "GET /api/v1/scheduled-tasks"+description: "Returns a paginated list of all scheduled tasks belonging to the user"+---++Returns a paginated list of all scheduled tasks belonging to the user, ordered by creation date. Each task includes basic information like schedule type, next run time, and status.++## Query Parameters++<ParamField query="page" type="integer" default="1">+ Page number (minimum: 1)+</ParamField>+<ParamField query="limit" type="integer" default="10">+ Number of items per page (minimum: 1)+</ParamField>++## Response++<ResponseField name="tasks" type="array">+ List of scheduled tasks+ <ResponseField name="id" type="string">+ The unique identifier for the scheduled task+ </ResponseField>+ <ResponseField name="task" type="string">+ Instructions for what the agent should do+ </ResponseField>+ <ResponseField name="save_browser_data" type="boolean">+ Whether to save browser cookies and data+ </ResponseField>+ <ResponseField name="structured_output_json" type="string">+ JSON schema for structured output+ </ResponseField>+ <ResponseField name="llm_model" type="string">+ LLM model to use+ </ResponseField>+ <ResponseField name="use_adblock" type="boolean">+ Whether to use an adblocker+ </ResponseField>+ <ResponseField name="use_proxy" type="boolean">+ Whether to use a proxy+ </ResponseField>+ <ResponseField name="highlight_elements" type="boolean">+ Whether to highlight elements on the page+ </ResponseField>+ <ResponseField name="schedule_type" type="string">+ Type of schedule: "interval" or "cron"+ </ResponseField>+ <ResponseField name="interval_minutes" type="integer">+ Minutes between runs+ </ResponseField>+ <ResponseField name="cron_expression" type="string">+ Cron expression for scheduling+ </ResponseField>+ <ResponseField name="start_at" type="string">+ When to start the schedule+ </ResponseField>+ <ResponseField name="next_run_at" type="string">+ When the next run is scheduled+ </ResponseField>+ <ResponseField name="end_at" type="string">+ When to end the schedule+ </ResponseField>+ <ResponseField name="is_active" type="boolean">+ Whether the scheduled task is active+ </ResponseField>+ <ResponseField name="created_at" type="string">+ When the scheduled task was created+ </ResponseField>+ <ResponseField name="updated_at" type="string">+ When the scheduled task was last updated+ </ResponseField>+</ResponseField>++<ResponseField name="total_pages" type="integer">+ Total number of pages+</ResponseField>++<ResponseField name="page" type="integer">+ Current page number+</ResponseField>++<ResponseField name="limit" type="integer">+ Number of items per page+</ResponseField>++<ResponseField name="total_count" type="integer">+ Total number of scheduled tasks+</ResponseField>++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/scheduled-tasks"++headers = {"Authorization": "Bearer <token>"}++response = requests.request("GET", url, headers=headers)++print(response.text)+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/scheduled-tasks \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "tasks": [+ {+ "id": "scheduled_task_1234567890abcdef",+ "task": "Visit example.com and check if the site is up",+ "save_browser_data": false,+ "structured_output_json": null,+ "llm_model": "gpt-4o",+ "use_adblock": true,+ "use_proxy": true,+ "highlight_elements": true,+ "schedule_type": "interval",+ "interval_minutes": 60,+ "cron_expression": null,+ "start_at": "2023-01-01T00:00:00Z",+ "next_run_at": "2023-01-01T01:00:00Z",+ "end_at": "2023-12-31T23:59:59Z",+ "is_active": true,+ "created_at": "2023-01-01T00:00:00Z",+ "updated_at": "2023-01-01T00:00:00Z"+ }+ ],+ "total_pages": 1,+ "page": 1,+ "limit": 10,+ "total_count": 1+}+```++</ResponseExample>diff --git a/docs/api-reference/list-tasks.mdx b/docs/api-reference/list-tasks.mdxnew file mode 100644index 000000000..8834b9258--- /dev/null+++ b/docs/api-reference/list-tasks.mdx@@ -0,0 +1,133 @@+---+title: "List Tasks"+api: "GET /api/v1/tasks"+description: "Get a paginated list of all tasks"+---++Returns a paginated list of all tasks belonging to the user, ordered by creation date. Each task includes basic information like status and creation time. For detailed task info, use the get task endpoint.++<ParamField query="page" type="integer" default="1">+ Page number (minimum: 1)+</ParamField>++<ParamField query="limit" type="integer" default="10">+ Number of items per page (minimum: 1)+</ParamField>++<ResponseField name="tasks" type="array">+ List of simplified task objects+ <ResponseField name="id" type="string">+ Unique identifier for the task+ </ResponseField>+ <ResponseField name="task" type="string">+ Original task instructions+ </ResponseField>+ <ResponseField name="output" type="string">+ Final output or result from the task+ </ResponseField>+ <ResponseField name="status" type="string">+ Current status of the task+ </ResponseField>+ <ResponseField name="created_at" type="string">+ ISO 8601 timestamp of task creation+ </ResponseField>+ <ResponseField name="finished_at" type="string">+ ISO 8601 timestamp of task completion+ </ResponseField>+ <ResponseField name="live_url" type="string">+ URL to view live task execution+ </ResponseField>+</ResponseField>++<ResponseField name="total_pages" type="integer">+ Total number of pages available+</ResponseField>++<ResponseField name="page" type="integer">+ Current page number+</ResponseField>++<ResponseField name="limit" type="integer">+ Number of items per page+</ResponseField>++<ResponseField name="total_count" type="integer">+ Total number of tasks across all pages+</ResponseField>++<RequestExample>+```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++# Get first page with 20 tasks+params = {'page': 1, 'limit': 20}+response = requests.get(f'{BASE_URL}/tasks', headers=HEADERS, params=params)+tasks_data = response.json()++print(f"Found {tasks_data['total_count']} total tasks")+print(f"Showing page {tasks_data['page']} of {tasks_data['total_pages']}")++for task in tasks_data['tasks']:+ print(f"Task {task['id']}: {task['status']}")+```+</RequestExample>++<ResponseExample>+```json+{+ "tasks": [+ {+ "id": "task_1234567890abcdef",+ "task": "Visit example.com and take a screenshot",+ "output": "Screenshot taken successfully",+ "status": "finished",+ "created_at": "2023-01-01T12:00:00Z",+ "finished_at": "2023-01-01T12:01:30Z",+ "live_url": "https://live.browser-use.com/task/1234567890abcdef"+ },+ {+ "id": "task_0987654321fedcba",+ "task": "Check product availability on shopping site",+ "output": null,+ "status": "running",+ "created_at": "2023-01-01T11:30:00Z",+ "finished_at": null,+ "live_url": "https://live.browser-use.com/task/0987654321fedcba"+ }+ ],+ "total_pages": 5,+ "page": 1,+ "limit": 10,+ "total_count": 42+}+```+</ResponseExample>++## Pagination++The API uses cursor-based pagination:++- **page**: Start from page 1+- **limit**: Maximum 100 items per page+- **total_pages**: Use this to implement pagination UI+- **total_count**: Total number of tasks across all pages++## Ordering++Tasks are ordered by creation date (newest first). This ensures that recently created tasks appear at the top of the list.++## Use Cases++This endpoint is useful for:+- Building task management dashboards+- Monitoring task execution status+- Filtering tasks by status+- Implementing task history views++<Note>+This endpoint returns simplified task objects for performance. Use the individual task endpoint to get complete task details including steps and browser data.+</Note>diff --git a/docs/api-reference/pause-task.mdx b/docs/api-reference/pause-task.mdxnew file mode 100644index 000000000..05c31000f--- /dev/null+++ b/docs/api-reference/pause-task.mdx@@ -0,0 +1,79 @@+---+title: "Pause Task"+api: "PUT /api/v1/pause-task"+description: "Pauses execution of a running task"+---++Pauses execution of a running task. The task can be resumed later using the `/resume-task` endpoint. Useful for manual intervention or inspection.++## Parameters++<ParamField query="task_id" type="string" required>+ ID of the task to pause+</ParamField>++## Response++The endpoint returns an empty response body with a 200 status code on success.++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/pause-task"+params = {"task_id": "task_1234567890abcdef"}+headers = {"Authorization": "Bearer <token>"}++response = requests.request("PUT", url, headers=headers, params=params)++print(response.text)+```++```bash cURL+curl --request PUT \+ --url 'https://api.browser-use.com/api/v1/pause-task?task_id=task_1234567890abcdef' \+ --header 'Authorization: Bearer <token>'+```++```javascript javascript+const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};++fetch('https://api.browser-use.com/api/v1/pause-task?task_id=task_1234567890abcdef', options)+ .then(response => response.json())+ .then(response => console.log(response))+ .catch(err => console.error(err));+```+</RequestExample>++<ResponseExample>+ ```json 200+ {}+ ```++ ```json 422+ {+ "detail": [+ {+ "loc": [+ "query",+ "task_id"+ ],+ "msg": "field required",+ "type": "value_error.missing"+ }+ ]+ }+ ```+</ResponseExample>++## Usage Notes++- Paused tasks can be resumed using the `/resume-task` endpoint+- The task status will change to "paused"+- Browser automation will be temporarily halted+- Useful for manual intervention or inspection during task execution++<Info>+Pausing is useful when you need to temporarily halt execution to inspect the current state or make manual adjustments before resuming.+</Info>diff --git a/docs/api-reference/ping.mdx b/docs/api-reference/ping.mdxnew file mode 100644index 000000000..a309710ee--- /dev/null+++ b/docs/api-reference/ping.mdx@@ -0,0 +1,38 @@+---+title: "Ping"+api: "GET /api/v1/ping"+description: "Check if the server is running and responding"+---++Use this endpoint to check if the server is running and responding. This is the only endpoint that doesn't require authentication.++## Response++A successful response has a 200 status code with an empty JSON object.++<RequestExample>++```python python+import requests++BASE_URL = 'https://api.browser-use.com/api/v1'++response = requests.get(f'{BASE_URL}/ping')+if response.status_code == 200:+ print("Server is up and running")+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/ping+```++</RequestExample>++<ResponseExample>++```json 200+{}+```++</ResponseExample>diff --git a/docs/api-reference/resume-task.mdx b/docs/api-reference/resume-task.mdxnew file mode 100644index 000000000..f8772d1f7--- /dev/null+++ b/docs/api-reference/resume-task.mdx@@ -0,0 +1,79 @@+---+title: "Resume Task"+api: "PUT /api/v1/resume-task"+description: "Resumes execution of a previously paused task"+---++Resumes execution of a previously paused task. The task will continue from where it was paused. You can't resume a stopped task.++## Parameters++<ParamField query="task_id" type="string" required>+ ID of the task to resume+</ParamField>++## Response++The endpoint returns an empty response body with a 200 status code on success.++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/resume-task"+params = {"task_id": "task_1234567890abcdef"}+headers = {"Authorization": "Bearer <token>"}++response = requests.request("PUT", url, headers=headers, params=params)++print(response.text)+```++```bash cURL+curl --request PUT \+ --url 'https://api.browser-use.com/api/v1/resume-task?task_id=task_1234567890abcdef' \+ --header 'Authorization: Bearer <token>'+```++```javascript javascript+const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};++fetch('https://api.browser-use.com/api/v1/resume-task?task_id=task_1234567890abcdef', options)+ .then(response => response.json())+ .then(response => console.log(response))+ .catch(err => console.error(err));+```+</RequestExample>++<ResponseExample>+ ```json 200+ {}+ ```++ ```json 422+ {+ "detail": [+ {+ "loc": [+ "query",+ "task_id"+ ],+ "msg": "field required",+ "type": "value_error.missing"+ }+ ]+ }+ ```+</ResponseExample>++## Usage Notes++- Only paused tasks can be resumed+- The task status will change from "paused" to "running"+- Browser automation will continue from where it was paused+- Stopped tasks cannot be resumed - you must create a new task instead++<Warning>+You cannot resume a task that has been stopped. Only paused tasks can be resumed.+</Warning>diff --git a/docs/api-reference/run-task.mdx b/docs/api-reference/run-task.mdxnew file mode 100644index 000000000..1f4fe801c--- /dev/null+++ b/docs/api-reference/run-task.mdx@@ -0,0 +1,182 @@+---+title: "Run Task"+api: "POST /api/v1/run-task"+description: "Requires an active subscription. Returns the task ID that can be used to track progress."+---++Creates a new browser automation task and returns the task ID that can be used to track progress.++## Request Body++<ParamField body="task" type="string" required>+ Instructions for what the agent should do. You can try it out at https://cloud.browser-use.com/+</ParamField>++<ParamField body="secrets" type="object">+ Dictionary of secrets to be used by the agent. Secrets are safely encrypted before storing in the database.+</ParamField>++<ParamField body="allowed_domains" type="array">+ List of domains that the agent is allowed to visit. If not set, the agent will be allowed to visit all domains (not recommended if you are using secrets).+</ParamField>++<ParamField body="save_browser_data" type="boolean" default="false">+ If set to True, the browser cookies and other data will be saved. Cookies are safely encrypted before storing in the database.+</ParamField>++<ParamField body="structured_output_json" type="string">+ If set, the agent will use this JSON schema as the output model (see example here: https://docs.browser-use.com/cloud/implementation#structured-output-example).+</ParamField>++<ParamField body="llm_model" type="string" default="gpt-4.1">+ LLM model to use.+ Available options:+ - gpt-4o+ - gpt-4o-mini+ - gpt-4.1+ - gpt-4.1-mini+ - gemini-2.5-flash+ - claude-sonnet-4-20250514+</ParamField>++<ParamField body="use_adblock" type="boolean" default="true">+ If set to True, the agent will use an adblocker.+</ParamField>++<ParamField body="use_proxy" type="boolean" default="true">+ If set to True, the agent will use a (mobile) proxy. Note that proxy is required for captcha solving, so if you disable proxy, you will not be able to solve captchas.+</ParamField>++<ParamField body="proxy_country_code" type="string" default="us">+ Country code for residential proxy. Must be one of: 'us', 'fr', 'it', 'jp', 'au', 'de', 'fi', 'ca'. Default is 'us'.+</ParamField>++<ParamField body="highlight_elements" type="boolean" default="true">+ If set to True, the agent will highlight the elements on the page.+</ParamField>++<ParamField body="included_file_names" type="array">+ File names to include in the task (note: use uploads/presigned-url endpoint to upload the files first!). E.g. ['file1.txt', 'file2.csv']+</ParamField>++<ParamField body="browser_viewport_width" type="integer" default="1280">+ Width of the browser viewport in pixels. Default is 1280.+</ParamField>++<ParamField body="browser_viewport_height" type="integer" default="960">+ Height of the browser viewport in pixels. Default is 960.+</ParamField>++<ParamField body="max_agent_steps" type="integer" default="75">+ Maximum number of agent steps to take. Default is 75. Maximum is 200.+</ParamField>++<ParamField body="enable_public_share" type="boolean" default="false">+ If set to True, enables public sharing of the task execution. When enabled, a public_share_url will be generated that allows others to view the task results without authentication.+</ParamField>++## Response++<ResponseField name="id" type="string">+ The unique identifier for the created task.+</ResponseField>+++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/run-task"++payload = {+ "task": "<string>",+ "secrets": {},+ "allowed_domains": ["<string>"],+ "save_browser_data": True,+ "structured_output_json": "<string>",+ "llm_model": "gpt-4o",+ "use_adblock": True,+ "use_proxy": True,+ "proxy_country_code": "us",+ "highlight_elements": True,+ "included_file_names": ["<string>"],+ "browser_viewport_width": 123,+ "browser_viewport_height": 123,+ "max_agent_steps": 123,+ "enable_public_share": True+}+headers = {+ "Authorization": "Bearer <token>",+ "Content-Type": "application/json"+}++response = requests.request("POST", url, json=payload, headers=headers)++print(response.text)+```++```bash cURL+curl --request POST \+ --url https://api.browser-use.com/api/v1/run-task \+ --header 'Authorization: Bearer <token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "task": "<string>",+ "secrets": {},+ "allowed_domains": [+ "<string>"+ ],+ "save_browser_data": true,+ "structured_output_json": "<string>",+ "llm_model": "gpt-4o",+ "use_adblock": true,+ "use_proxy": true,+ "proxy_country_code": "us",+ "highlight_elements": true,+ "included_file_names": [+ "<string>"+ ],+ "browser_viewport_width": 123,+ "browser_viewport_height": 123,+ "max_agent_steps": 123,+ "enable_public_share": true+}'+```++```javascript javascript+const options = {+ method: 'POST',+ headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},+ body: '{"task":"<string>","secrets":{},"allowed_domains":["<string>"],"save_browser_data":true,"structured_output_json":"<string>","llm_model":"gpt-4o","use_adblock":true,"use_proxy":true,"proxy_country_code":"us","highlight_elements":true,"included_file_names":["<string>"],"browser_viewport_width":123,"browser_viewport_height":123,"max_agent_steps":123,"enable_public_share":true}'+};++fetch('https://api.browser-use.com/api/v1/run-task', options)+ .then(response => response.json())+ .then(response => console.log(response))+ .catch(err => console.error(err));++```+</RequestExample>++<ResponseExample>+ ```json 200+ {+ "id": "task_1234567890abcdef"+ }+ ```++ ```json 422+ {+ "detail": [+ {+ "loc": [+ "<string>"+ ],+ "msg": "<string>",+ "type": "<string>"+ }+ ]+ }+ ```+</ResponseExample>diff --git a/docs/api-reference/stop-task.mdx b/docs/api-reference/stop-task.mdxnew file mode 100644index 000000000..24655d408--- /dev/null+++ b/docs/api-reference/stop-task.mdx@@ -0,0 +1,79 @@+---+title: "Stop Task"+api: "PUT /api/v1/stop-task"+description: "Stops a running browser automation task immediately."+---++Stops a running browser automation task immediately. The task cannot be resumed after being stopped. Use `/pause-task` endpoint instead if you want to temporarily halt execution.++## Parameters++<ParamField query="task_id" type="string" required>+ ID of the task to stop+</ParamField>++## Response++The endpoint returns an empty response body with a 200 status code on success.++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/stop-task"+params = {"task_id": "task_1234567890abcdef"}+headers = {"Authorization": "Bearer <token>"}++response = requests.request("PUT", url, headers=headers, params=params)++print(response.text)+```++```bash cURL+curl --request PUT \+ --url 'https://api.browser-use.com/api/v1/stop-task?task_id=task_1234567890abcdef' \+ --header 'Authorization: Bearer <token>'+```++```javascript javascript+const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};++fetch('https://api.browser-use.com/api/v1/stop-task?task_id=task_1234567890abcdef', options)+ .then(response => response.json())+ .then(response => console.log(response))+ .catch(err => console.error(err));+```+</RequestExample>++<ResponseExample>+ ```json 200+ {}+ ```++ ```json 422+ {+ "detail": [+ {+ "loc": [+ "query",+ "task_id"+ ],+ "msg": "field required",+ "type": "value_error.missing"+ }+ ]+ }+ ```+</ResponseExample>++## Usage Notes++- Once a task is stopped, it cannot be resumed+- The task status will change to "stopped"+- Any ongoing browser automation will be immediately terminated+- Use the pause endpoint if you need to temporarily halt execution with the ability to resume later++<Warning>+Stopping a task is irreversible. If you need to pause execution temporarily, use the `/pause-task` endpoint instead.+</Warning>diff --git a/docs/api-reference/update-scheduled-task.mdx b/docs/api-reference/update-scheduled-task.mdxnew file mode 100644index 000000000..2b05ca5fd--- /dev/null+++ b/docs/api-reference/update-scheduled-task.mdx@@ -0,0 +1,185 @@+---+title: "Update Scheduled Task"+api: "PUT /api/v1/scheduled-task/{task_id}"+description: "Updates a scheduled task with partial updates"+---++Updates a scheduled task with partial updates. You can update any combination of the task configuration fields without affecting the others.++## Path Parameters++<ParamField path="task_id" type="string" required>+ ID of the scheduled task to update+</ParamField>++## Request Body++<ParamField body="task" type="string">+ Instructions for what the agent should do+</ParamField>+<ParamField body="schedule_type" type="string">+ Type of schedule: "interval" or "cron"+</ParamField>+<ParamField body="interval_minutes" type="integer">+ Minutes between runs (required if schedule_type is "interval")+</ParamField>+<ParamField body="cron_expression" type="string">+ Cron expression for scheduling (required if schedule_type is "cron")+</ParamField>+<ParamField body="start_at" type="string">+ When to start the schedule (ISO 8601 format)+</ParamField>+<ParamField body="end_at" type="string">+ When to end the schedule (ISO 8601 format)+</ParamField>+<ParamField body="is_active" type="boolean">+ Whether the scheduled task is active+</ParamField>+<ParamField body="use_adblock" type="boolean">+ Whether to use an adblocker+</ParamField>+<ParamField body="use_proxy" type="boolean">+ Whether to use a proxy+</ParamField>+<ParamField body="highlight_elements" type="boolean">+ Whether to highlight elements on the page+</ParamField>+<ParamField body="llm_model" type="string">+ LLM model to use. Available options: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o4-mini, o3, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash-preview-04-17, gemini-2.5-flash, gemini-2.5-pro, claude-3-7-sonnet-20250219, claude-sonnet-4-20250514, llama-4-maverick-17b-128e-instruct+</ParamField>+<ParamField body="save_browser_data" type="boolean">+ Whether to save browser cookies and data between runs+</ParamField>+<ParamField body="structured_output_json" type="string">+ JSON schema for structured output+</ParamField>++## Response++Returns the updated scheduled task object with the same format as the Get Scheduled Task response.++<ResponseField name="id" type="string">+ The unique identifier for the scheduled task+</ResponseField>++<ResponseField name="task" type="string">+ Instructions for what the agent should do+</ResponseField>++<ResponseField name="save_browser_data" type="boolean">+ Whether to save browser cookies and data+</ResponseField>++<ResponseField name="structured_output_json" type="string">+ JSON schema for structured output+</ResponseField>++<ResponseField name="llm_model" type="string">+ LLM model to use+</ResponseField>++<ResponseField name="use_adblock" type="boolean">+ Whether to use an adblocker+</ResponseField>++<ResponseField name="use_proxy" type="boolean">+ Whether to use a proxy+</ResponseField>++<ResponseField name="highlight_elements" type="boolean">+ Whether to highlight elements on the page+</ResponseField>++<ResponseField name="schedule_type" type="string">+ Type of schedule: "interval" or "cron"+</ResponseField>++<ResponseField name="interval_minutes" type="integer">+ Minutes between runs+</ResponseField>++<ResponseField name="cron_expression" type="string">+ Cron expression for scheduling+</ResponseField>++<ResponseField name="start_at" type="string">+ When to start the schedule+</ResponseField>++<ResponseField name="next_run_at" type="string">+ When the next run is scheduled+</ResponseField>++<ResponseField name="end_at" type="string">+ When to end the schedule+</ResponseField>++<ResponseField name="is_active" type="boolean">+ Whether the scheduled task is active+</ResponseField>++<ResponseField name="created_at" type="string">+ When the scheduled task was created+</ResponseField>++<ResponseField name="updated_at" type="string">+ When the scheduled task was last updated+</ResponseField>++<RequestExample>++```python python+import requests++url = "https://api.browser-use.com/api/v1/scheduled-task/{task_id}"++headers = {"Authorization": "Bearer <token>"}++payload = {+ "task": "Updated task description",+ "is_active": False+}++response = requests.request("PUT", url, headers=headers, json=payload)++print(response.text)+```++```bash curl+curl --request PUT \+ --url https://api.browser-use.com/api/v1/scheduled-task/{task_id} \+ --header 'Authorization: Bearer <token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "task": "Updated task description",+ "is_active": false+ }'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "id": "scheduled_task_1234567890abcdef",+ "task": "Updated task description",+ "save_browser_data": false,+ "structured_output_json": null,+ "llm_model": "gpt-4o",+ "use_adblock": true,+ "use_proxy": true,+ "highlight_elements": true,+ "schedule_type": "interval",+ "interval_minutes": 60,+ "cron_expression": null,+ "start_at": "2023-01-01T00:00:00Z",+ "next_run_at": "2023-01-01T01:00:00Z",+ "end_at": "2023-12-31T23:59:59Z",+ "is_active": false,+ "created_at": "2023-01-01T00:00:00Z",+ "updated_at": "2023-01-01T00:30:00Z"+}+```++</ResponseExample>diff --git a/docs/api-reference/upload-file-presigned-url.mdx b/docs/api-reference/upload-file-presigned-url.mdxnew file mode 100644index 000000000..842d45056--- /dev/null+++ b/docs/api-reference/upload-file-presigned-url.mdx@@ -0,0 +1,115 @@+---+title: "Upload File Presigned URL"+api: "POST /api/v1/uploads/presigned-url"+description: "Returns a presigned URL for uploading a file to the user's files bucket"+---++Returns a presigned URL for uploading a file to the user's files bucket. After uploading a file, you can include it in tasks using the `included_file_names` field in the `RunTaskRequest`.++## Request Body++<ParamField body="file_name" type="string" required>+ Name of the file to upload (e.g., 'data.csv', 'image.png')+</ParamField>+<ParamField body="content_type" type="string" required>+ Content type of the file (e.g., 'text/csv', 'image/png', 'application/pdf'). Only images and documents are supported.+</ParamField>++## Response++<ResponseField name="upload_url" type="string">+ A presigned URL to upload the file to.+</ResponseField>++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++# Step 1: Get a presigned URL+file_data = {+ "file_name": "data.csv",+ "content_type": "text/csv"+}++response = requests.post(f'{BASE_URL}/uploads/presigned-url', headers=HEADERS, json=file_data)+upload_url = response.json()['upload_url']++# Step 2: Upload the file to the presigned URL+with open('local_data.csv', 'rb') as file:+ file_content = file.read()++upload_response = requests.put(upload_url, data=file_content, headers={+ 'Content-Type': 'text/csv'+})++if upload_response.status_code == 200:+ print("File uploaded successfully")++# Step 3: Use the file in a task+task_data = {+ "task": "Process the data in the CSV file and extract the top 5 rows",+ "included_file_names": ["data.csv"]+}++task_response = requests.post(f'{BASE_URL}/run-task', headers=HEADERS, json=task_data)+task_id = task_response.json()['id']+print(f"Task created with ID: {task_id}")+```++```bash curl+curl --request POST \+ --url https://api.browser-use.com/api/v1/uploads/presigned-url \+ --header 'Authorization: Bearer <token>' \+ --header 'Content-Type: application/json' \+ --data '{+ "file_name": "data.csv",+ "content_type": "text/csv"+ }'+```++</RequestExample>++<ResponseExample>++```json 200+{+ "upload_url": "https://storage.browser-use.com/uploads/user_123/data.csv?signature=..."+}+```++</ResponseExample>++## File Usage in Tasks++To use uploaded files in your tasks, include their names in the `included_file_names` array when creating a task:++```json+{+ "task": "Process the data in the CSV file and extract the top 5 rows",+ "included_file_names": ["data.csv", "config.json"]+}+```++The agent will have access to these files during task execution and can read their contents.++## Supported File Types++The following file types are supported for upload:++- Text files: `.txt`, `.csv`, `.json`, `.xml`, `.html`, `.md`+- Images: `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp`+- Documents: `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ppt`, `.pptx`++## File Size Limits++- Maximum file size: 10 MB per file+- Maximum total size of all files for a task: 50 MB++<Note>+Files are automatically deleted after 30 days unless they are used in a scheduled task.+</Note>diff --git a/docs/api-reference/user.mdx b/docs/api-reference/user.mdxnew file mode 100644index 000000000..26ab137c4--- /dev/null+++ b/docs/api-reference/user.mdx@@ -0,0 +1,61 @@+---+title: "Me"+api: "GET /api/v1/me"+description: "Returns a boolean value indicating if the API key is valid and the user is authenticated"+---++Returns a boolean value indicating if the API key is valid and the user is authenticated.++## Response++The endpoint returns a boolean value directly (not wrapped in an object):+- `true` if the API key is valid and the user is authenticated+- `false` if the API key is invalid or the user is not authenticated++<RequestExample>++```python python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++response = requests.get(f'{BASE_URL}/me', headers=HEADERS)+is_authenticated = response.json()+if is_authenticated:+ print("API key is valid")+else:+ print("API key is invalid")+```++```bash curl+curl --request GET \+ --url https://api.browser-use.com/api/v1/me \+ --header 'Authorization: Bearer <token>'+```++</RequestExample>++<ResponseExample>++```json 200+true+```++```json 401+false+```++</ResponseExample>++## Usage Notes++- This endpoint is useful for validating API keys before making other API calls+- Unlike other endpoints, this returns a simple boolean value rather than an object+- A `true` response confirms both authentication and authorization+- This endpoint can be used for health checks of your API integration++<Tip>+Use this endpoint to verify your API key is working correctly before making other API calls, especially in automated systems.+</Tip>diff --git a/docs/cloud/authentication.mdx b/docs/cloud/authentication.mdxnew file mode 100644index 000000000..278b02a48--- /dev/null+++ b/docs/cloud/authentication.mdx@@ -0,0 +1,48 @@+---+title: "Authentication"+description: "Learn how to authenticate with the Browser Use Cloud API"+icon: "lock"+---++The Browser Use Cloud API uses API keys to authenticate requests. You can obtain an API key from your [Browser Use Cloud dashboard](https://cloud.browser-use.com/settings/api-keys).++## API Keys++All API requests must include your API key in the `Authorization` header:++```bash+Authorization: Bearer YOUR_API_KEY+```++Keep your API keys secure and do not share them in publicly accessible areas such as GitHub, client-side code, or in your browser's developer tools. API keys should be stored securely in environment variables or a secure key management system.++## Example Request++Here's an example of how to include your API key in a request using Python:++```python+import requests++API_KEY = 'your_api_key_here'+BASE_URL = 'https://api.browser-use.com/api/v1'+HEADERS = {'Authorization': f'Bearer {API_KEY}'}++response = requests.get(f'{BASE_URL}/me', headers=HEADERS)+print(response.json())+```++## Verifying Authentication++You can verify that your API key is valid by making a request to the `/api/v1/me` endpoint. See the [Me endpoint documentation](../api-reference/user) for more details.++## API Key Security++To ensure the security of your API keys:++1. **Never share your API key** in publicly accessible areas+2. **Rotate your API keys** periodically+3. **Use environment variables** to store API keys in your applications+4. **Implement proper access controls** for your API keys+5. **Monitor API key usage** for suspicious activity++If you believe your API key has been compromised, you should immediately revoke it and generate a new one from your Browser Use Cloud dashboard.diff --git a/docs/docs.json b/docs/docs.jsonnew file mode 100644index 000000000..d2112349f--- /dev/null+++ b/docs/docs.json@@ -0,0 +1,134 @@+{+ "$schema": "https://mintlify.com/docs.json",+ "theme": "mint",+ "name": "Browser Use",+ "colors": {+ "primary": "#F97316",+ "light": "#FFF7ED",+ "dark": "#C2410C"+ },+ "favicon": "/favicon.ico",+ "navigation": {+ "tabs": [+ {+ "tab": "Documentation",+ "groups": [+ {+ "group": "Get Started",+ "pages": [+ "introduction",+ "quickstart",+ "cli"+ ]+ },+ {+ "group": "Customize",+ "pages": [+ "customize/supported-models",+ "customize/agent-settings",+ "customize/browser-settings",+ "customize/real-browser",+ "customize/output-format",+ "customize/system-prompt",+ "customize/sensitive-data",+ "customize/custom-functions",+ "customize/mcp-client",+ "customize/mcp-server",+ "customize/hooks"+ ]+ },+ {+ "group": "Development",+ "pages": [+ "development/contribution-guide",+ "development/local-setup",+ "development/telemetry",+ "development/observability",+ "development/evaluations",+ "development/roadmap"+ ]+ }++ ]+ },+ {+ "tab": "Cloud API",+ "groups": [+ {+ "group": "Cloud API",+ "pages": [+ "cloud/quickstart",+ "cloud/implementation",+ "cloud/webhooks",+ "cloud/authentication"+ ]+ },+ {+ "group": "API v1.0",+ "pages": [+ "api-reference/run-task",+ "api-reference/stop-task",+ "api-reference/pause-task",+ "api-reference/resume-task",+ "api-reference/get-task",+ "api-reference/get-task-status",+ "api-reference/get-task-media",+ "api-reference/get-task-screenshots",+ "api-reference/get-task-gif",+ "api-reference/get-task-output-file",+ "api-reference/list-tasks",+ "api-reference/upload-file-presigned-url",+ "api-reference/create-scheduled-task",+ "api-reference/list-scheduled-tasks",+ "api-reference/get-scheduled-task",+ "api-reference/update-scheduled-task",+ "api-reference/delete-scheduled-task",+ "api-reference/delete-browser-profile",+ "api-reference/check-balance",+ "api-reference/user",+ "api-reference/ping"+ ]+ }+ ]+ }+ ]+ },+ "logo": {+ "light": "/logo/light.svg",+ "dark": "/logo/dark.svg",+ "href": "https://browser-use.com"+ },+ "api": {+ "playground": {+ "display": "interactive"+ },+ "examples": {+ "languages": ["javascript", "curl", "python"],+ "required": true+ }+ },+ "navbar": {+ "links": [+ {+ "label": "Github",+ "href": "https://github.com/browser-use/browser-use"+ },+ {+ "label": "Twitter",+ "href": "https://x.com/gregpr07"+ }+ ],+ "primary": {+ "type": "button",+ "label": "Join Discord",+ "href": "https://link.browser-use.com/discord"+ }+ },+ "footer": {+ "socials": {+ "x": "https://x.com/browser_use",+ "github": "https://github.com/browser-use/browser-use",+ "linkedin": "https://linkedin.com/company/browser-use"+ }+ }+}diff --git a/docs/mint.json b/docs/mint.jsondeleted file mode 100644index 07cc292a9..000000000--- a/docs/mint.json+++ /dev/null@@ -1,90 +0,0 @@-{- "$schema": "https://mintlify.com/schema.json",- "name": "Browser Use",- "logo": {- "dark": "/logo/dark.svg",- "light": "/logo/light.svg",- "href": "https://browser-use.com"- },- "favicon": "/favicon.ico",- "colors": {- "primary": "#F97316",- "light": "#FFF7ED",- "dark": "#C2410C",- "anchors": {- "from": "#F97316",- "to": "#FB923C"- },- "background": {- "dark": "#0D0A09"- }- },- "feedback": {- "thumbsRating": true,- "raiseIssue": true,- "suggestEdit": true- },- "topbarLinks": [- {- "name": "Github",- "url": "https://github.com/browser-use/browser-use"- },- {- "name": "Twitter",- "url": "https://x.com/gregpr07"- }- ],- "topbarCtaButton": {- "name": "Join Discord",- "url": "https://link.browser-use.com/discord"- },- "tabs": [- {- "name": "Cloud API",- "url": "cloud",- "openapi": "https://api.browser-use.com/openapi.json"- }- ],- "navigation": [- {- "group": "Get Started",- "pages": ["introduction", "quickstart", "cli"]- },- {- "group": "Customize",- "pages": [- "customize/supported-models",- "customize/agent-settings",- "customize/browser-settings",- "customize/real-browser",- "customize/output-format",- "customize/system-prompt",- "customize/sensitive-data",- "customize/custom-functions",- "customize/mcp-client",- "customize/mcp-server",- "customize/hooks"- ]- },- {- "group": "Development",- "pages": [- "development/contribution-guide",- "development/local-setup",- "development/telemetry",- "development/observability",- "development/evaluations",- "development/roadmap"- ]- },- {- "group": "Cloud API",- "pages": ["cloud/quickstart", "cloud/implementation", "cloud/webhooks"]- }- ],- "footerSocials": {- "x": "https://x.com/gregpr07",- "github": "https://github.com/browser-use/browser-use",- "linkedin": "https://linkedin.com/company/browser-use"- }-}