# GRABO Browser: instructions for AI agents

GRABO Browser gives you (the agent) your own real Chrome on a fixed US residential IP. Cookies and logins persist between runs. Your human can watch it live and take over for a login, captcha or payment, then hand it back.

- Base URL: `https://browser.grabo.tools`
- Price: 7 days free with no card, then $5/month.
- Auth: `Authorization: Bearer <api_key>` on every call. Keys start with `gb_`.

## 1. Get a key (sign up or sign in, same flow)

Check for a saved key first: `cat ~/.config/grabo-browser/key`. If it exists, skip to step 2.

```bash
curl -s -X POST https://browser.grabo.tools/api/auth/start -H 'Content-Type: application/json' \
  -d '{"email":"HUMAN_EMAIL","label":"claude-code on my laptop"}'
# -> {"login_id":"l_...", ...}
```

A 6-digit code and a one-click approval link go to that email. Then either:

- **You can read the mailbox, or your human tells you the code:**
  ```bash
  curl -s -X POST https://browser.grabo.tools/api/auth/verify -H 'Content-Type: application/json' \
    -d '{"login_id":"l_...","code":"123456"}'
  ```
- **Your human clicks "Approve" in the email.** Poll every 3 seconds (up to 15 minutes):
  ```bash
  curl -s "https://browser.grabo.tools/api/auth/poll?login_id=l_..."
  # {"status":"pending"} ... then {"status":"approved","api_key":"gb_..."}
  ```

Tell your human: "I sent a sign-in code to EMAIL. Tell me the 6 digits, or click Approve in that email."

Both return `api_key`. Save it:

```bash
mkdir -p ~/.config/grabo-browser && umask 077 && echo 'gb_...' > ~/.config/grabo-browser/key
```

A new email starts the 7-day free trial. An existing email signs in and gets a new key.

## 2. Browse

Every call starts the browser if it is not running (first start takes about 5 seconds). Set `K=$(cat ~/.config/grabo-browser/key)`.

```bash
# open a page; returns url, title, status and a snapshot with element refs
curl -s -X POST https://browser.grabo.tools/api/browser/navigate -H "Authorization: Bearer $K" \
  -H 'Content-Type: application/json' -d '{"url":"https://news.ycombinator.com"}'
```

The snapshot lists every link, button and field with a ref:

```
- link "Login" [ref=e12]
- textbox "Search" [ref=e31]
```

Act on refs (or on `selector` / `text`):

| Endpoint (POST, JSON body) | Body | Does |
|---|---|---|
| `/api/browser/navigate` | `{"url"}` | Open a URL, wait, return a snapshot |
| `/api/browser/snapshot` | `{"max_chars"?}` | Refs for everything on the page |
| `/api/browser/read` | `{"format":"text"\|"html"}` | Page text or HTML |
| `/api/browser/click` | `{"ref"}` or `{"selector"}` or `{"text"}` or `{"x","y"}` | Click |
| `/api/browser/type` | `{"ref","value","submit"?:true}` | Replace a field's text, optionally press Enter |
| `/api/browser/press` | `{"key":"Enter"}` | Key or chord (`Control+A`, `Tab`, `Escape`) |
| `/api/browser/select` | `{"ref","option"}` | Pick a `<select>` option by value or label |
| `/api/browser/scroll` | `{"dy":800}` or `{"ref"}` | Scroll |
| `/api/browser/wait` | `{"text"}` or `{"selector"}` or `{"ms"}` | Wait (max 30 s) |
| `/api/browser/back`, `/forward`, `/reload` | `{}` | History |
| `/api/browser/tabs` | `{"action":"list"\|"new"\|"select"\|"close","index"?,"url"?}` | Tabs |
| `/api/browser/evaluate` | `{"expression":"document.title"}` | Run JavaScript, get the result |
| `/api/browser/screenshot` | `{"full_page"?}` | JPEG image of the page |
| `/api/browser/stop` | `{}` | Close the browser (profile is kept) |
| `GET /api/me` | | Plan, trial days left, exit IP, keys |

Refs change when the page changes: take a new snapshot after navigation or big updates.

## 3. When you need your human (login, captcha, 2FA, payment)

Solve what you can first. When a person must act:

```bash
curl -s -X POST https://browser.grabo.tools/api/browser/handoff -H "Authorization: Bearer $K" \
  -H 'Content-Type: application/json' -d '{"note":"Please log in to your bank, then press Done."}'
# -> {"view_url":"https://browser.grabo.tools/v/...", "expires":"..."}
```

Send `view_url` to your human. It opens the live browser with your note and a **Done, hand back** button, no sign-in needed (valid 60 minutes). Poll until they finish:

```bash
curl -s https://browser.grabo.tools/api/browser/handoff -H "Authorization: Bearer $K"   # {"done":true}
```

Your human can also watch and take over any time at https://browser.grabo.tools/app.

## Other ways to connect

**MCP** (Claude Code, Cursor, Codex, any MCP client). Streamable HTTP at `https://browser.grabo.tools/mcp`:

```bash
claude mcp add --transport http grabo-browser https://browser.grabo.tools/mcp --header "Authorization: Bearer $K"
```

Tools: `browser_navigate`, `browser_snapshot`, `browser_read`, `browser_click`, `browser_type`, `browser_press`, `browser_select`, `browser_scroll`, `browser_wait`, `browser_back`, `browser_forward`, `browser_reload`, `browser_tabs`, `browser_evaluate`, `browser_screenshot`, `browser_handoff`, `browser_handoff_status`, `browser_status`, `browser_stop`.

**Playwright or Puppeteer over CDP**, the same browser and profile:

```js
const browser = await chromium.connectOverCDP('wss://browser.grabo.tools/cdp?key=' + KEY);
const page = browser.contexts()[0].pages()[0];
```

Use the existing context (`browser.contexts()[0]`); it holds the saved logins. Call `browser.close()` only to disconnect.

**Claude Code skill**:

```bash
mkdir -p ~/.claude/skills/grabo-browser && curl -fsS https://browser.grabo.tools/skill.md -o ~/.claude/skills/grabo-browser/SKILL.md
```

## Errors

| Status | Meaning | Do |
|---|---|---|
| 401 | Missing or revoked key | Run step 1 again |
| 402 | Trial ended, no plan | Give your human `pay_url` from the response ($5/month, card checkout) |
| 429 | Too many sign-in attempts | Wait 10 minutes |
| 503 | All browsers busy, or start failed | Retry in a minute |

## Good to know

- One browser per account, up to a few tabs. It closes after 10 minutes without use and reopens on the next call with the same profile, cookies and IP.
- The exit IP is fixed to your account, so sites see one consistent US home connection.
- Do not share the key; revoke keys at https://browser.grabo.tools/app → Connect agent.
