# doc-json HTML/Web Page to Structured JSON Extractor

> doc-json HTML/Web Page to Structured JSON Extractor is a paid API for AI agents from doc-json.agent-utils.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Converts raw HTML content into clean, structured JSON including metadata, readable text, headings, tables, schema.org JSON-LD, links, and Open Graph data for AI agent consumption

## Facts

- Endpoint: POST https://doc-json.agent-utils.workers.dev/v1/html
- 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/doc-json-html-web-page-to-structured-json-extractor-4650a1fd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__NhEQ7BoZZJOnldkK0k9L

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 doc-json-html-web-page-to-structured-json-extractor-4650a1fd -d '<json body>'
```

Example prompt: Take this raw HTML from the product page and extract everything useful — clean readable text, any tables, schema.org product data, headings, and metadata — structured as JSON so I can process it further.

## When to prefer this

Choose this endpoint when you have raw HTML content already fetched and need to extract structured data without making another HTTP request — ideal for pipelines where you control the fetch step. It excels at pulling schema.org/JSON-LD data, HTML tables, and clean readable text in one call. Prefer it over URL-fetching extractors when you need to pass pre-fetched HTML, handle authenticated pages, or work with locally modified HTML.

## Known failure modes

- HTML input missing or empty — returns error requiring 'html' query param
- HTML too large — maxChars capped at 200,000 characters, content truncated beyond that
- Malformed HTML — parser may miss elements or return partial data
- No schema.org JSON-LD present — jsonLd array will be empty
- Payment not completed via x402 — request blocked before processing

## How this service works

Web pages, PDFs and feeds turned into clean structured JSON for AI agents: metadata, schema.org data, tables, headings, readable text, per-page PDF text, feed items. Pay per call over x402, no API key.

## Output

A JSON object containing: clean readable text (nav/scripts/footers stripped), page title, author, language, word count, character count, canonical URL, meta tags, Open Graph properties, Twitter card data, parsed schema.org JSON-LD blocks, up to 20 HTML tables with headers and rows, hierarchical headings with levels, internal/external link counts with a sample, image count, fetch timestamp, and a truncation flag.

## 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": [
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "html"
     ],
     "properties": {
      "html": {
       "type": "string",
       "maxLength": 2000000
      },
      "baseUrl": {
       "type": "string",
       "description": "Base URL used to resolve relative links"
      },
      "maxChars": {
       "type": "integer",
       "default": 20000,
       "maximum": 200000,
       "minimum": 500
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "meta": {
       "type": "object",
       "additionalProperties": {
        "type": "string"
       }
      },
      "text": {
       "type": "string",
       "description": "Readable text without nav, scripts, footers"
      },
      "chars": {
       "type": "integer"
      },
      "links": {
       "type": "object",
       "properties": {
        "sample": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "href": {
            "type": "string"
           },
           "text": {
            "type": "string"
           }
          }
         }
        },
        "external": {
         "type": "integer"
        },
        "internal": {
         "type": "integer"
        }
       }
      },
      "title": {
       "type": [
        "string",
        "null"
       ]
      },
      "author": {
       "type": [
        "string",
        "null"
       ]
      },
      "images": {
       "type": "integer"
      },
      "jsonLd": {
       "type": "array",
       "items": {},
       "description": "Parsed schema.org JSON-LD blocks (products, articles, organizations, events...)"
      },
      "status": {
       "type": "integer"
      },
      "tables": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "rows": {
          "type": "array",
          "items": {
      
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "meta": {},
  "text": "Hi\nHi\n1 2",
  "chars": 8,
  "links": {
   "sample": [],
   "external": 0,
   "internal": 0
  },
  "title": "Hi",
  "author": null,
  "images": 0,
  "jsonLd": [],
  "tables": [
   {
    "rows": [
     [
      "1",
      "2"
     ]
    ],
    "caption": null,
    "headers": [
     "a",
     "b"
    ]
   }
  ],
  "twitter": {},
  "headings": [
   {
    "text": "Hi",
    "level": 1
   }
  ],
  "language": null,
  "canonical": null,
  "openGraph": {},
  "truncated": false,
  "wordCount": 3,
  "description": null,
  "publishedAt": null
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/doc-json-html-web-page-to-structured-json-extractor-4650a1fd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from doc-json.agent-utils.workers.dev](https://www.zero.xyz/host/doc-json.agent-utils.workers.dev/llms.txt)
