# URL Parser & Resolver

> URL Parser & Resolver is a paid API for AI agents from toolbelt402.tpoborne.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Parses an absolute URL into its component parts (host, path, query params, fragment, origin) or resolves a relative reference against a base URL.

## Facts

- Endpoint: GET https://toolbelt402.tpoborne.workers.dev/url/parse
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/url-parser-resolver-e1e8ef9d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EFjImxxmM_qgwwjTc9aUT

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 url-parser-resolver-e1e8ef9d
```

Example prompt: Can you parse this URL for me — https://example.com/search?q=hello&page=2#results — and give me the host, path, query params as JSON, fragment, and origin?

## When to prefer this

Choose this endpoint when you need to programmatically decompose a URL into structured parts (host, path, query params as JSON, fragment, origin) or resolve a relative URL reference against a base — especially in automation pipelines where manual string splitting is error-prone. It handles edge cases like port numbers, encoded characters, and fragment identifiers correctly.

## Known failure modes

- Missing required 'url' query param returns an error
- Invalid or malformed URL string that cannot be parsed
- Missing 'base' or 'ref' when using resolve mode
- Relative URL passed without a base URL for resolution
- Payment not included or insufficient (x402 payment required)

## How this service works

Parse a URL into parts — host, path, query params as JSON, fragment, origin — or resolve a relative reference against a base URL correctly.

## Output

A JSON object containing the parsed URL components: host, pathname, query parameters as a key-value JSON object, fragment/hash, origin, protocol, and optionally the fully resolved absolute URL when used in resolve mode.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "ref": {
       "type": "string",
       "description": "Resolve mode: relative reference to resolve against base"
      },
      "url": {
       "type": "string",
       "description": "Absolute URL to parse"
      },
      "base": {
       "type": "string",
       "description": "Resolve mode: base URL"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-parser-resolver-e1e8ef9d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
