# URL Validator and Component Parser

> URL Validator and Component Parser is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-13).

Validates URL syntax against RFC 3986 and parses a URL into its components: protocol, hostname, port, pathname, search, and hash.

## Facts

- Endpoint: GET https://api.x402node.dev/validate/url
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-3045e420
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_k0aHU3auiljeCIEjMPuDr

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 api-x402node-dev-3045e420
```

Example prompt: Can you check if 'https://sub.example.com:8080/path/to/page?query=1#section' is a valid URL and break it down into its protocol, hostname, port, and pathname for me?

## When to prefer this

Use this endpoint when you need to programmatically validate whether a user-supplied or scraped URL is well-formed before passing it downstream, or when you need to reliably extract specific URL components (hostname, port, pathname) without writing custom parsing logic. Prefer this over client-side parsing when you want a consistent, server-side RFC 3986-compliant result with minimal setup.

## Known failure modes

- Empty or missing URL input returns an error or valid:false
- Malformed JSON request body causes a 400-level error
- Extremely long or unusual strings may cause unexpected parsing behavior
- Relative URLs (no scheme) may be flagged as invalid even if structurally reasonable
- Network timeouts if the API is temporarily unavailable

## How this service works

URL validator, URL format check, URL parser, URL syntax validation, protocol scheme detector, domain parser, query string parser, URL component extractor, RFC 3986 URI validation. Validate URL syntax and parse into components: protocol, hostname, port, pathname, search, hash. Accepts payment on Base or Solana — either network works.

## Output

Returns a JSON object with the original URL string, a boolean 'valid' flag indicating whether the URL is syntactically correct, and parsed components: protocol (e.g. 'https:'), hostname (e.g. 'example.com'), port (e.g. '8080' or null), and pathname (e.g. '/path/to/page'). If the URL is invalid, component fields may be null.

## Example request

```json
{
 "url": "https://sub.example.com:8080/path/to/page?query=1#section"
}
```

## 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": {
      "url": {
       "type": "string",
       "description": "Target URL (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-3045e420/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
