ThinkRun

llms.txt

Browser Control

Direct browser automation endpoints. All require a valid session ID.

Navigation

POST/api/sessions/:sessionId/navigate

Navigate to a URL. Waits for the page to load before returning.

Body Parameters

urlstringrequiredTarget URL (must include protocol)
waitUntilstringLoad event: load, domcontentloaded, networkidle (default: load)

Response

{
  "success": true,
  "title": "Example Domain",
  "url": "https://example.com/"
}
POST/api/sessions/:sessionId/go-back

Navigate back in browser history. Uses Playwright goBack() in cloud, chrome.tabs.goBack() locally.

Body Parameters

waitUntilstringLoad event: load, domcontentloaded (default: load)
timeoutnumberMax wait in ms (default: 30000)

Response

{
  "success": true,
  "url": "https://example.com/page1",
  "title": "Page 1",
  "navigated": true
}
POST/api/sessions/:sessionId/go-forward

Navigate forward in browser history.

Body Parameters

waitUntilstringLoad event: load, domcontentloaded (default: load)
timeoutnumberMax wait in ms (default: 30000)

Response

{
  "success": true,
  "url": "https://example.com/page2",
  "title": "Page 2",
  "navigated": true
}

Interaction

POST/api/sessions/:sessionId/click

Click an element on the page.

Body Parameters

selectorstringrequiredCSS selector of the element to click

Response

{
  "success": true,
  "selector": "button.submit"
}
POST/api/sessions/:sessionId/type

Type text character by character (triggers keyboard events).

Body Parameters

selectorstringrequiredCSS selector of the input element
textstringrequiredText to type

Response

{
  "success": true,
  "selector": "input[name=search]",
  "text": "hello world"
}
POST/api/sessions/:sessionId/fill

Fill an input field instantly (sets value directly, faster than type).

Body Parameters

selectorstringrequiredCSS selector of the input element
valuestringrequiredValue to fill

Response

{
  "success": true,
  "selector": "input[name=email]",
  "value": "[email protected]"
}
POST/api/sessions/:sessionId/press

Press a keyboard key (e.g. Enter, Tab, Escape, ArrowDown).

Body Parameters

keystringrequiredKey name (e.g. "Enter", "Tab", "Escape")

Response

{
  "success": true,
  "key": "Enter"
}
POST/api/sessions/:sessionId/select

Select an option from a dropdown element.

Body Parameters

selectorstringrequiredCSS selector of the select element
valuestringrequiredOption value to select

Response

{
  "success": true,
  "selector": "select#country",
  "value": "US"
}
POST/api/sessions/:sessionId/hover

Hover over an element to trigger hover styles or tooltips.

Body Parameters

selectorstringrequiredCSS selector of the element

Response

{
  "success": true,
  "selector": ".tooltip-trigger"
}
POST/api/sessions/:sessionId/scroll

Scroll the page or scroll a specific element into view.

Body Parameters

selectorstringCSS selector to scroll into view (if provided, x/y are ignored)
xnumberHorizontal scroll position in pixels (default: 0)
ynumberVertical scroll position in pixels (default: 0)

Response

{
  "success": true
}

Data Extraction

POST/api/sessions/:sessionId/screenshot

Capture a screenshot. Optionally stores it as an artifact.

Body Parameters

typestring"png", "jpeg", or "webp" (default: png)
fullPagebooleanCapture full scrollable page (default: false)
uploadbooleanStore as artifact (default: true)
qualitynumberImage quality 0-100 (for jpeg/webp, default: 80)

Response

{
  "success": true,
  "format": "png",
  "size": 145320,
  "artifactId": "obj-abc123",
  "publicUrl": "https://storage.example.com/..."
}
POST/api/sessions/:sessionId/extract

Extract page content in various formats.

Body Parameters

typestringrequired"html", "text", "dom", or "evaluate"
selectorstringExtract from specific element (for html/text/dom)
scriptstringJavaScript expression (for type=evaluate)

Response

{
  "success": true,
  "type": "text",
  "content": "Example Domain\nThis domain is for..."
}
POST/api/sessions/:sessionId/evaluate

Execute JavaScript in the browser and return the result.

Body Parameters

scriptstringrequiredJavaScript expression or function body

Response

{
  "success": true,
  "result": "Example Domain"
}
POST/api/sessions/:sessionId/snapshot

Get the accessibility tree (aria snapshot) of the current page. Lightweight alternative to DOM extraction.

Response

{
  "success": true,
  "ariaSnapshot": "- document: Example Domain\n  - heading \"Example Domain\"\n  - paragraph: This domain is..."
}
POST/api/sessions/:sessionId/wait

Wait for an element, navigation, or timeout.

Body Parameters

selectorstringWait for element to appear
timeoutnumberMax wait in ms (default: 5000)
statestring"visible", "hidden", "attached" (default: visible)

Response

{
  "success": true,
  "waited": "selector",
  "selector": ".modal",
  "durationMs": 230
}
POST/api/sessions/:sessionId/wait-for-text

Wait for specific text to appear on the page. High-value for agents waiting for loading states, confirmation messages, or dynamic content.

Body Parameters

textstringrequiredText to wait for (max 1000 chars)
timeoutnumberMax wait in ms (default: 30000, max: 60000)

Response

{
  "success": true,
  "found": true
}

Dialog Handling

GET/api/sessions/:sessionId/dialog

Check for pending browser dialogs (alert, confirm, prompt) and view dialog history.

Response

{
  "success": true,
  "hasDialog": true,
  "dialog": { "type": "confirm", "message": "Are you sure?" },
  "history": [
    { "type": "alert", "message": "Welcome!", "action": "auto-dismissed", "timestamp": "..." }
  ]
}
POST/api/sessions/:sessionId/dialog

Accept or dismiss a pending browser dialog. Dialogs auto-dismiss after 30 seconds if not handled.

Body Parameters

acceptbooleanAccept (true) or dismiss (false). Default: true
promptTextstringText to enter for prompt dialogs

Response

{
  "success": true,
  "action": "accepted"
}

Page Cache (Stateless)

One-shot URL fetch with no browser session. Auth: same as all other endpoints (x-api-key). Cloud mode consumes credits (HTML/text: 1, screenshot: 3). Local mode is free. Force local-only with options.sensitive: true or header X-Page-Cache-Sensitive: true.

POST/api/cache/html

Fetch rendered HTML for a URL without a browser session. Accept: text/html returns raw HTML; Accept: application/json (default) returns JSON envelope.

Body Parameters

urlstringrequiredTarget URL (must be http/https, no private IPs)
options.providerstring"cloud" (default) or "local" — "auto" returns 400; cloud uses ScrapingDog when configured
options.sensitivebooleanForce local provider; URL never sent to third parties
options.waitForstring|numberload | domcontentloaded | networkidle (default) | positive ms
options.timeoutnumberNavigation timeout ms (default: 30000, max: 60000)
options.proxyobject{ server: string, username?: string, password?: string } — outbound proxy for the page fetch
options.javascriptbooleanEnable JavaScript execution (default: true)
options.userAgentstringCustom User-Agent string (max 2000 chars)
options.headersobjectAdditional HTTP request headers
options.adBlockingbooleanOnly true is accepted (false is rejected by schema); ad blocking always active
options.textFormatstringOnly "plain" is accepted (additional formats not yet implemented)

Response

{
  "success": true,
  "html": "<!doctype html>...",
  "metadata": {
    "provider": "cloud",
    "url": "https://example.com",
    "fetchedAt": "2026-04-16T10:00:00Z"
  }
}
POST/api/cache/text

Extract plain text for a URL without a browser session. Accept: text/plain returns raw text; Accept: application/json (default) returns JSON envelope.

Body Parameters

urlstringrequiredTarget URL
optionsobjectSame options as /api/cache/html

Response

{
  "success": true,
  "text": "Example Domain\nThis domain is for use in illustrative examples...",
  "metadata": { "provider": "cloud", "url": "https://example.com" }
}
POST/api/cache/screenshot

Capture a PNG screenshot for a URL without a browser session. Accept: image/png returns raw PNG bytes; Accept: application/json (default) uploads to R2 and returns artifactUrl.

Body Parameters

urlstringrequiredTarget URL
options.fullPagebooleanCapture full scrollable page (default: false)
options.maxDimensionnumberResize longest edge to N pixels (default: 1280)
options.viewportobject{ width, height } viewport before capture
options.providerstring"cloud" (default) or "local"

Response

{
  "success": true,
  "artifactUrl": "https://pub-xxx.r2.dev/page-cache-abc123.png",
  "metadata": {
    "provider": "cloud",
    "url": "https://example.com",
    "objectId": "page-cache-abc123"
  }
}