POST
/
api
/
v1
/
scheduled-task
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}")
{
  "id": "scheduled_task_1234567890abcdef"
}

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.

This endpoint requires an active subscription.

Request Body

task
string
required

Instructions for what the agent should do

schedule_type
string
required

Type of schedule: “interval” or “cron”

interval_minutes
integer

Minutes between runs (required for interval schedule)

cron_expression
string

Cron expression for scheduling (required for cron schedule)

start_at
string

When to start the schedule (ISO 8601 format, defaults to now)

end_at
string

When to end the schedule (ISO 8601 format, defaults to 1 year from now)

secrets
object

Dictionary of secrets to be used by the agent (safely encrypted before storing)

allowed_domains
array

List of domains the agent is allowed to visit

save_browser_data
boolean
default:"false"

Whether to save browser cookies and data between runs

structured_output_json
string

JSON schema for structured output

llm_model
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

use_adblock
boolean
default:"true"

Whether to use an adblocker

use_proxy
boolean
default:"true"

Whether to use a proxy

proxy_country_code
string
default:"us"

Country code for residential proxy. Must be one of: us, uk, fr, it, jp, au, de, fi, ca, in

highlight_elements
boolean
default:"true"

Whether to highlight elements on the page

included_file_names
array

File names to include in the task

browser_viewport_width
integer
default:"1280"

Width of browser viewport in pixels

browser_viewport_height
integer
default:"960"

Height of browser viewport in pixels

max_agent_steps
integer
default:"75"

Maximum number of agent steps (max: 200)

enable_public_share
boolean
default:"false"

Whether to enable public sharing of task executions

*Either interval_minutes or cron_expression is required depending on the schedule_type.

Response

id
string

The unique identifier for the created scheduled task.

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}")
{
  "id": "scheduled_task_1234567890abcdef"
}