# Agent402 UK URL Parser

> Agent402 UK URL Parser is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Parses an absolute URL into its structured components (host, path, query map, origin) using the WHATWG URL standard — deterministically, without model hallucination.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/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/agent402-uk-url-parser-b19ccba7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AHN8PVRngPaT6Qn1tMiLy

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 agent402-uk-url-parser-b19ccba7 -d '<json body>'
```

Example prompt: Can you parse this URL for me — https://example.com/products?category=shoes&count=3 — and give me the hostname, path, and query parameters as a structured map?

## When to prefer this

Use this endpoint when you need deterministic, spec-compliant URL parsing without relying on the language model to split URLs itself — especially when query parameter extraction accuracy matters, when you need a structured query map rather than a raw string, or when you need to reliably extract the hostname or origin from a user-supplied URL inside an agentic pipeline.

## Known failure modes

- Invalid or relative URL returns valid:false
- Missing 'url' field in request body causes a 400-level error
- Non-absolute URLs (e.g. paths like '/foo/bar') may fail validation
- Malformed query strings may result in partially populated query map
- Network timeout if the service is temporarily unavailable

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object containing the parsed URL components: hostname, path, origin, a query map (key-value pairs from the query string), and a boolean 'valid' flag indicating whether the input is a well-formed absolute URL per the WHATWG standard.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Absolute URL"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "query": {
   "count": "3"
  },
  "valid": true,
  "hostname": "agent402.co.uk"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-url-parser-b19ccba7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
