🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Remote Browser Service

by @vasyaod

Control a remote Chrome browser via HTTP API (Kubernetes or Docker backend). Use for web automation, form filling, navigation, and page inspection on sites t...

TERMINAL
clawhub install remote-browser-service

πŸ“– About This Skill


name: remote-browser-service description: > Control a remote Chrome browser in Kubernetes via HTTP API. Use for web automation, scraping, form filling, navigation, and page inspection. Exposes accessibility tree, text extraction, screenshots, and actions β€” optimized for AI agents. Requires an active browser session (created via HTTP or WebSocket). metadata: openclaw: emoji: "🌐" requires: env: - name: AC_API_KEY secret: true optional: true description: "Bearer token or API key for auth (user_id derived from token)"

Remote Browser Service

Browser control for AI agents via HTTP API. Workflow: navigate, snapshot, act.

Setup

Ensure you have an active session:

1. Create session β€” POST /api/sessions (HTTP, no WebSocket), or open WebSocket to /ws/{session_id} (DevTools CDP), or run from UI 2. Or restore β€” Use stored session from GET /api/stored-sessions 3. Auth β€” Pass Authorization: Bearer or X-API-Key, or ?access_token=

Base URL: https://rb.all-completed.com (or RBS_BASE_URL). Replace {session_id} in examples. User ID is derived from the token.

Core Workflow

1. Navigate to a URL 2. Snapshot the accessibility tree (get refs) β€” GET .../json 3. Act on refs or selectors (click, type, fill, press) 4. Snapshot again to see results

Refs (e0, e1, …) from /json can be used with /action via selector (use ref as selector for e5 β†’ "e5" maps to role/name; for now use CSS selector).

API Reference

Create session (HTTP)

curl -X POST "https://rb.all-completed.com/api/sessions" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{}'

Optional body: {"session_id": "my-session"}

Sessions idle for 5 min are closed. Use POST .../ping to keep alive.

List sessions

curl "https://rb.all-completed.com/api/sessions" \
  -H "Authorization: Bearer "

List stored sessions

curl "https://rb.all-completed.com/api/stored-sessions" \
  -H "Authorization: Bearer "

Returns {sessions: [...], count}. Connect via WebSocket to /ws/{session_id} to resume.

Navigate

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/navigate" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

With timeout (seconds)

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/navigate" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "timeout": 60}'

Snapshot (accessibility tree)

# Full tree
curl "https://rb.all-completed.com/api/sessions/{session_id}/json" \
  -H "Authorization: Bearer "

Interactive elements only (buttons, links, inputs) β€” much smaller

curl "https://rb.all-completed.com/api/sessions/{session_id}/json?filter=interactive" \ -H "Authorization: Bearer "

Limit depth

curl "https://rb.all-completed.com/api/sessions/{session_id}/json?depth=5" \ -H "Authorization: Bearer "

Returns {nodes: [{ref, role, name, depth, value?, disabled?, focused?, nodeId?}], count}.

Extract text

# Readability mode (default) β€” strips nav/footer/ads
curl "https://rb.all-completed.com/api/sessions/{session_id}/text" \
  -H "Authorization: Bearer "

Raw innerText

curl "https://rb.all-completed.com/api/sessions/{session_id}/text?mode=raw" \ -H "Authorization: Bearer "

Returns {url, title, text}. Cheapest option (~800 tokens for most pages).

Screenshot

# JSON with base64
curl "https://rb.all-completed.com/api/sessions/{session_id}/screenshot" \
  -H "Authorization: Bearer "

Raw JPEG bytes

curl "https://rb.all-completed.com/api/sessions/{session_id}/screenshot?raw=true" \ -H "Authorization: Bearer " \ -o screenshot.jpg

With quality (1-100)

curl "https://rb.all-completed.com/api/sessions/{session_id}/screenshot?quality=50&raw=true" \ -H "Authorization: Bearer " \ -o screenshot.jpg

Act on elements

# Click by selector
curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{"kind": "click", "selector": "button.submit"}'

Type into element (focus + insertText)

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"kind": "type", "selector": "#email", "text": "user@example.com"}'

Fill (set value directly)

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"kind": "fill", "selector": "#email", "text": "user@example.com"}'

Press a key

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"kind": "press", "key": "Enter"}'

Focus, hover, select, scroll

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"kind": "focus", "selector": "input[name=search]"}'

curl -X POST "https://rb.all-completed.com/api/sessions/{session_id}/action" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"kind": "scroll", "scrollY": 800}'

Action kinds: click, type, fill, press, focus, hover, select, scroll. Use selector (CSS) or ref (from snapshot). For press use key (e.g. Enter, Tab).

HTML snapshot

# Full DOM with inlined CSS (opens in browser)
curl "https://rb.all-completed.com/api/sessions/{session_id}/html" \
  -H "Authorization: Bearer "

Token Cost Guide

| Method | Typical tokens | When to use | |--------|----------------|-------------| | /text | ~800 | Reading page content | | /json?filter=interactive | ~3,600 | Finding buttons/links to click | | /json | ~10,500 | Full page structure | | /screenshot | ~2K (vision) | Visual verification |

Strategy: Use /text when you only need content. Use /json?filter=interactive for action-oriented tasks. Use full /json for complete page understanding. Use /screenshot for visual checks.

Environment Variables

| Var | Description | |-----|--------------| | RBS_BASE_URL | Base URL (e.g. https://rb.all-completed.com) | | AC_API_KEY | Bearer token or API key (user_id derived from token) |

Tips

  • Session required β€” Ensure a session exists before calling navigate/json/text/action. Create via POST /api/sessions (HTTP), WebSocket, or restore from stored sessions.
  • Refs from snapshot β€” Use selector with the ref string (e.g. "e5") when the action API supports refβ†’DOM resolution; otherwise prefer CSS selectors.
  • Readability vs raw β€” /text (default) strips nav/footer/ads; ?mode=raw returns full innerText.
  • Interactive filter β€” ?filter=interactive on /json reduces nodes by ~75% for action tasks.
  • Stored sessions β€” Sessions persist to S3 when WebSocket closes; list with GET /api/stored-sessions, then connect via WebSocket to resume.
  • βš™οΈ Configuration

    Ensure you have an active session:

    1. Create session β€” POST /api/sessions (HTTP, no WebSocket), or open WebSocket to /ws/{session_id} (DevTools CDP), or run from UI 2. Or restore β€” Use stored session from GET /api/stored-sessions 3. Auth β€” Pass Authorization: Bearer or X-API-Key, or ?access_token=

    Base URL: https://rb.all-completed.com (or RBS_BASE_URL). Replace {session_id} in examples. User ID is derived from the token.

    πŸ“‹ Tips & Best Practices

  • Session required β€” Ensure a session exists before calling navigate/json/text/action. Create via POST /api/sessions (HTTP), WebSocket, or restore from stored sessions.
  • Refs from snapshot β€” Use selector with the ref string (e.g. "e5") when the action API supports refβ†’DOM resolution; otherwise prefer CSS selectors.
  • Readability vs raw β€” /text (default) strips nav/footer/ads; ?mode=raw returns full innerText.
  • Interactive filter β€” ?filter=interactive on /json reduces nodes by ~75% for action tasks.
  • Stored sessions β€” Sessions persist to S3 when WebSocket closes; list with GET /api/stored-sessions, then connect via WebSocket to resume.