Automate

AI Task

Execute AI-powered browser automation tasks using natural language with optional geotargeting. This endpoint always streams responses using Server-Sent Events (SSE).

Streaming Response:

  • All responses are streamed using Server-Sent Events (text/event-stream)
  • Real-time progress updates and results as they're generated

Geotargeting:

  • Optionally specify a country code for geotargeted browsing

Use Cases:

  • Web scraping and data extraction
  • Form filling and interaction
  • Navigation and information gathering
  • Multi-step web workflows
  • Content analysis from web pages
post/automate

Request body

dataobject

JSON data to provide context for form filling or complex tasks

guardrailsstring

Safety constraints for execution

interactiveboolean

Enable interactive mode to allow human-in-the-loop input during task execution

maxIterationsinteger

Maximum task iterations

maxValidationAttemptsinteger

Maximum validation attempts

taskstring required

The task description in natural language

trusted_hostnamesstring[]

TrustedHostnames lists hostnames where the action firewall is bypassed for fills and submissions. WARNING: on listed hosts, prompt injection from page content can drive the agent to fill and submit any field, including personal and credential data. Use only for sites you fully trust to receive your data.

unsafe_modeboolean

UnsafeMode disables the action firewall entirely. WARNING: prompt injection from page content can then cause the agent to submit your data, including credentials, personal information, and conversation context, to attacker-controlled forms. Only enable for trusted, controlled environments.

urlstring uri

Starting URL for the task

Example request

{
  "geo_target": {
    "country": "US"
  },
  "guardrails": "browse and extract data only, don't star or fork repositories",
  "maxIterations": 50,
  "maxValidationAttempts": 3,
  "task": "Find the top 3 trending repositories on GitHub and extract their names, descriptions, and star counts",
  "url": "https://github.com/trending"
}

Response

Task executed successfully (always streaming)

Streaming Response using Server-Sent Events: All responses from the automate endpoint are streamed using Server-Sent Events.

Event Format:

  • Each event starts with event: <type> followed by data: <JSON>
  • Empty lines separate events

Event Types:

Task Events:

  • start: Task initialization
  • task:setup: Task configuration
  • task:started: Task execution begins
  • task:completed: Task finished successfully
  • task:aborted: Task was terminated
  • task:validated: Task completion validation
  • task:validation_error: Validation failed

Agent Events:

  • agent:processing: Agent thinking/planning
  • agent:status: Status updates and plans
  • agent:step: Processing step iterations
  • agent:action: Actions being performed
  • agent:reasoned: Agent reasoning output
  • agent:extracted: Data extraction results
  • agent:waiting: Agent waiting for operations

Browser Events:

  • browser:navigated: Page navigation events
  • browser:action_started: Browser action initiated
  • browser:action_completed: Browser action finished
  • browser:screenshot_captured: Screenshot taken

System Events:

  • system:debug_compression: Debug compression info
  • system:debug_message: Debug messages

Stream Control:

  • complete: End of stream with results
  • done: Stream termination
  • error: Error occurred

Changes