# URL Parser — Scheme, Host, Port, Path, Query, Fragment

> URL Parser — Scheme, Host, Port, Path, Query, Fragment is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Parses a URL string into its constituent components: scheme, host, port, path, query parameters, and fragment.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/url-parse
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/url-parser-scheme-host-port-path-query-fragment-d9172ea8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_icIXNcAbUwcVC1hKMm6qq

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-scheme-host-port-path-query-fragment-d9172ea8 -d '<json body>'
```

Example prompt: Can you break down this URL for me — https://example.com:8080/products/search?q=shoes&size=10#results — and tell me the scheme, host, port, path, query params, and fragment?

## When to prefer this

Choose this endpoint when you need a clean, structured breakdown of a URL into all its RFC-standard components without writing custom regex or string manipulation. Especially useful in agentic pipelines where downstream steps need individual URL parts (e.g. routing on path, filtering on query params, or reading fragment identifiers).

## Known failure modes

- Malformed or non-URL input returns an error indicating the string could not be parsed
- Missing scheme may cause parsing failure or ambiguous results
- Relative URLs without a base may not parse correctly
- Empty string input returns an error

## How this service works

Break a URL into scheme, host, port, path, query params, and fragment.

## Output

Returns a structured object containing the parsed URL components: scheme (e.g. 'https'), host (e.g. 'example.com'), port (e.g. 8080 or null if default), path (e.g. '/products/search'), query parameters as key-value pairs (e.g. {q: 'shoes', size: '10'}), and fragment (e.g. 'results').

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "host": "a.com"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-parser-scheme-host-port-path-query-fragment-d9172ea8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
