# 24K Labs URL Parser

> 24K Labs URL Parser 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 into its component parts: scheme, host, port, path, query parameters, and fragment.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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/24k-labs-url-parser-e9fc4aeb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YqHBwL1BjFF6cw2uTrf7i

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 24k-labs-url-parser-e9fc4aeb -d '<json body>'
```

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

## When to prefer this

Choose this endpoint when you need a reliable, structured decomposition of a URL into all its RFC-3986 components — especially when you need query parameters returned as parsed key-value pairs rather than a raw string. Prefer it over naive string splitting or regex when correctness across edge cases (ports, encoded characters, missing components) matters. At $0.001 per call it is cost-effective for on-demand agent workflows that encounter arbitrary URLs at runtime.

## Known failure modes

- Malformed or non-URL string input returns a parsing error or null fields
- Missing URL in request body returns a 400 bad request
- Extremely long URLs may be rejected due to size limits
- Relative URLs (no scheme/host) may produce partial or error results
- Payment failure or insufficient USDC balance prevents call from completing

## How this service works

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

## Output

Returns a structured breakdown of the provided URL, including the scheme (e.g. https), host (e.g. example.com), port (e.g. 8080 or null if default), path (e.g. /products/shoes), an object or list of query parameters (e.g. {color: 'red', size: '10'}), and the fragment identifier (e.g. reviews). Any absent component is returned as null or an empty value.

## 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/24k-labs-url-parser-e9fc4aeb/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)
