# Swift Bot Labs Toolbox – User-Agent Parser

> Swift Bot Labs Toolbox – User-Agent Parser is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Parses a User-Agent string and returns structured metadata including browser, OS, device type, and bot classification

## Facts

- Endpoint: GET https://x402-toolbox.swiftbotlab.workers.dev/v1/user-agent?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-user-agent-parser-249a3c6c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZhIXq-zU02rXajGM_-i7g

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability swift-bot-labs-toolbox-user-agent-parser-249a3c6c
```

Example prompt: Can you parse this user agent string for me — 'Mozilla/5.0 (compatible; GPTBot/1.0; +https://openai.com/gptbot)' — and tell me whether it's a bot, what kind, and what browser and OS it's using?

## When to prefer this

Choose this endpoint when you need a fast, cheap, no-account-required UA parser that distinguishes AI crawlers (like GPTBot, Claude, etc.) from regular browsers and generic bots — especially useful for agents that need to screen HTTP requests or analyze log data without setting up a full analytics pipeline. Prefer it over heavyweight analytics SDKs when you just need structured UA breakdown per-call at $0.003 USDC.

## Known failure modes

- Missing 'ua' query parameter returns an error response
- Unrecognized or malformed UA string may return nulls for most fields but still succeeds
- Payment failure (x402) if USDC balance is insufficient or x402 handshake fails
- Rate limits or worker errors on the Cloudflare edge may return 5xx

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

A JSON object with fields: ok (boolean), tool name ('user-agent'), and a result object containing: os (string or null), bot (string or null — bot name if detected), isBot (boolean), device (string e.g. 'bot', 'mobile', 'desktop'), browser (string or null), and botCategory (string or null e.g. 'ai-crawler').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "ua"
     ],
     "properties": {
      "ua": {
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "discoverable": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "user-agent",
  "result": {
   "os": null,
   "bot": "GPTBot",
   "isBot": true,
   "device": "bot",
   "browser": null,
   "botCategory": "ai-crawler"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-user-agent-parser-249a3c6c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
