# Swift Bot Labs URL Parser

> Swift Bot Labs URL 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, normalizes, and strips tracking parameters from a URL, returning its components (scheme, host, path, query, fragment) and a clean version.

## Facts

- Endpoint: GET https://x402-toolbox.swiftbotlab.workers.dev/v1/url/parse?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-url-parser-b01685e2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MCTFzoZHHHjvXIEzcUqT8

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-url-parser-b01685e2
```

Example prompt: Can you parse this URL for me and strip out all the tracking junk like utm_source and fbclid? Here it is: https://example.com/b/?id=7&fbclid=abc&utm_source=x#top

## When to prefer this

Use this endpoint when you need a deterministic, pay-per-call URL parsing utility with no API key setup — especially when you want tracking parameter stripping (UTM, fbclid) and URL normalization in a single step. Prefer over manual regex parsing or full browser-based URL libraries when running in an agent pipeline that supports x402 micropayments.

## Known failure modes

- Missing or malformed 'url' query parameter returns an error response
- Unparseable URL string returns valid:false in the result
- Non-HTTP/HTTPS schemes may not be supported
- Payment failure via x402 (insufficient USDC balance) results in 402 response before processing

## 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: ok (bool), tool name ('url-parse'), and a result object containing scheme, host, path, query (as key-value pairs), fragment, a normalized URL (query params sorted), a clean URL (tracking params removed), a list of removed tracking parameter names, and a valid flag indicating whether the URL was parseable.

## 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": [
      "url"
     ],
     "properties": {
      "url": {
       "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": "url-parse",
  "result": {
   "host": "example.com",
   "path": "/b/",
   "clean": "https://example.com/b/?id=7#top",
   "query": {
    "id": "7",
    "fbclid": "abc",
    "utm_source": "x"
   },
   "valid": true,
   "scheme": "https",
   "normalized": "https://example.com/b/?fbclid=abc&id=7&utm_source=x#top",
   "removedTracking": [
    "utm_source",
    "fbclid"
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-url-parser-b01685e2/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)
