# URL Parser (WHATWG)

> URL Parser (WHATWG) is a paid API for AI agents from url.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Parses an absolute URL string into its WHATWG-standard components including protocol, credentials, host, port, origin, pathname, path segments, query object, and hash.

## Facts

- Endpoint: POST https://url.openverbs.com/v1/parse
- Price: $0.002/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-whatwg-830bf9ad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZlGW-hw3ltU_--NZdmkKX

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-whatwg-830bf9ad -d '<json body>'
```

Example prompt: Can you parse this URL for me — 'https://user:pass@api.example.com:8080/v2/items?filter=active&page=2#results' — and give me all its components like the protocol, host, port, pathname, query parameters, and hash?

## When to prefer this

Use this endpoint when you need a reliable, standards-compliant (WHATWG) decomposition of a URL into all its named components in a single call — especially when you need the query string decoded into a structured key-value object and path segments as an array. Prefer it over regex-based parsing or manual string splitting when correctness and spec compliance matter.

## Known failure modes

- Non-absolute URLs (relative paths, protocol-relative) rejected with 400
- Malformed URLs with invalid characters return 400
- Empty or missing 'url' field returns 400 validation error
- URLs exceeding 8192 characters rejected
- Non-string input types rejected by schema validation

## How this service works

Parse an absolute URL into its WHATWG components: protocol/scheme, credentials, host/hostname/port, origin, pathname (plus path segments), search (plus a decoded query object) and hash. A string that is not a valid absolute URL is rejected as a clean 400.

## Output

A structured object containing all WHATWG URL components: protocol/scheme, username, password, host, hostname, port, origin, pathname, an array of path segments, the raw search/query string, a decoded query key-value object, and the hash/fragment. If the input is not a valid absolute URL, the endpoint returns a 400 error.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "maxLength": 8192,
       "minLength": 1,
       "description": "The absolute URL to parse."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-parser-whatwg-830bf9ad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from url.openverbs.com](https://www.zero.xyz/host/url.openverbs.com/llms.txt)
