Skip to content
Get started

AI Task

client.agent.automate(AgentAutomateParams { task, data, geo_target, 4 more } body, RequestOptionsoptions?): AutomateEvent { data, event } | Stream<AutomateEvent { data, event } >
POST/automate

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
ParametersExpand Collapse
body: AgentAutomateParams { task, data, geo_target, 4 more }
task: string

The task description in natural language

data?: unknown

JSON data to provide context for form filling or complex tasks

geo_target?: GeoTarget

Optional geotargeting parameters for proxy requests

country?: string

Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB", "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

guardrails?: string

Safety constraints for execution

maxIterations?: number

Maximum task iterations

maximum100
minimum1
maxValidationAttempts?: number

Maximum validation attempts

maximum10
minimum1
url?: string

Starting URL for the task

formaturi
ReturnsExpand Collapse
AutomateEvent { data, event }
data?: unknown

Event payload data

event?: string

The event type (e.g., start, agent:processing, complete)

AutomateEvent { data, event }
data?: unknown

Event payload data

event?: string

The event type (e.g., start, agent:processing, complete)

AI Task

import Tabstack from '@tabstack/sdk';

const client = new Tabstack({
  apiKey: process.env['TABSTACK_API_KEY'], // This is the default and can be omitted
});

const automateEvent = await client.agent.automate({
  task: 'Find the top 3 trending repositories and extract their names, descriptions, and star counts',
  guardrails: "browse and extract only, don't interact with repositories",
  url: 'https://github.com/trending',
});

console.log(automateEvent.data);
event: start data: {"task": "Find the top 3 trending repositories", "url": "https://github.com/trending"} event: agent:processing data: {"operation": "Creating task plan", "hasScreenshot": false} event: browser:navigated data: {"title": "Trending - GitHub", "url": "https://github.com/trending"} event: agent:extracted data: {"extractedData": "[{\"name\": \"awesome-ai\", \"stars\": \"45.2k\"}]"} event: task:completed data: {"success": true, "finalAnswer": "Top 3 trending repos extracted"} event: complete data: {"success": true} event: done data: {}
{
  "error": "maxIterations must be between 1 and 100"
}
Returns Examples
event: start data: {"task": "Find the top 3 trending repositories", "url": "https://github.com/trending"} event: agent:processing data: {"operation": "Creating task plan", "hasScreenshot": false} event: browser:navigated data: {"title": "Trending - GitHub", "url": "https://github.com/trending"} event: agent:extracted data: {"extractedData": "[{\"name\": \"awesome-ai\", \"stars\": \"45.2k\"}]"} event: task:completed data: {"success": true, "finalAnswer": "Top 3 trending repos extracted"} event: complete data: {"success": true} event: done data: {}
{
  "error": "maxIterations must be between 1 and 100"
}