# URL to JSON

> URL to JSON is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Fetches a web page, strips it to readable text, and returns only the requested fields as schema-enforced JSON — optionally extracting all repeated records as an array.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/url-to-json
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/url-to-json-e1aaaf74
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_39f0mbn_3rgyxC9nl9y1S

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-to-json-e1aaaf74
```

Example prompt: Go to https://www.amazon.com/dp/B09G9FPHY6 and pull out the price, rating, and product title as JSON — just those three fields.

## When to prefer this

Choose this endpoint when you need 1–10 specific facts from a public webpage and want clean JSON back without writing any parsing or scraping code. It's ideal for agents that need a single fact (price, author, date) or a list of repeated records (search results, table rows) from a page, and want to avoid dealing with raw HTML. Prefer it over a raw HTTP fetch + LLM parse combo when you want schema-enforced output and cost predictability at $0.04/call.

## Known failure modes

- Page is behind a login wall or CAPTCHA — fields returned as null
- URL is unreachable or returns a non-200 status — request fails with an error
- Requested fields don't exist on the page — fields returned as null or empty
- JavaScript-rendered content not visible in static HTML — fields may be missing
- More than 10 fields requested — may be rejected or truncated
- Ambiguous field names that match multiple elements — may return unexpected values

## How this service works

One call replaces two: fetches the page, strips it to readable text, then returns exactly the fields you asked for as schema-enforced JSON (fields=price,author,published — up to 10). Add list=true to pull EVERY repeated record on the page (listings, table rows, search results) as an array — that mode costs $0.06, since it needs a much larger output budget. Built for agents that need a fact off a page, not a pile of HTML — no browser, no parser, no scraping code.

## Output

A JSON object containing only the requested fields extracted from the target webpage. If list=true is set, returns a JSON array where each element is one repeated record (e.g. one listing, one table row) with the requested fields. Fields not found on the page may be null or absent.

## 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"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url",
      "fields"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "Page URL"
      },
      "list": {
       "type": "string",
       "description": "Extract all records (true/false)"
      },
      "fields": {
       "type": "string",
       "description": "Fields (comma-separated)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-to-json-e1aaaf74/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
