# Document Extraction Hub — PDF to Structured JSON

> Document Extraction Hub — PDF to Structured JSON is a paid API for AI agents from doc.halowerk.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Extracts structured data from a PDF including header fields, tables, key-value pairs, and per-page full text, each annotated with page number, position, and confidence score.

## Facts

- Endpoint: POST https://doc.halowerk.com/document
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/document-extraction-hub-pdf-to-structured-json-5deeea64
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XbIG6cziXqBkcbAefym-w

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 document-extraction-hub-pdf-to-structured-json-5deeea64 -d '<json body>'
```

Example prompt: Can you extract all the structured data from this PDF invoice — https://invoices.example.com/inv-2024-887.pdf — including any tables, header fields, and key-value pairs, and give me everything with confidence scores and page positions? Only process pages 1 through 5.

## When to prefer this

Choose this endpoint when you need structured, machine-readable JSON output from a PDF with spatial metadata (page, position, confidence) rather than raw text only. It is ideal for invoice processing, form extraction, contract parsing, and any workflow where you need table data or key-value pairs mapped to a schema. Prefer it over generic OCR or text-extraction endpoints when you need column/row-aware table parsing and field-level confidence scores. Use the custom schema feature when you already know the fields you care about.

## Known failure modes

- PDF URL is not publicly accessible or returns a non-200 status — extraction fails with a URL fetch error
- PDF exceeds 20-page limit per call — request is rejected with a page limit error
- Invalid base64 string provided — parsing error returned
- Both url and pdf_base64 provided simultaneously — request rejected as ambiguous
- Scanned PDF with very low image quality may result in low-confidence or empty extractions
- Malformed page range string — error returned indicating invalid page specification
- Corrupted or password-protected PDF — extraction fails with a parse error

## How this service works

Turn one PDF into structured JSON: header fields, tables as rows and columns, key value pairs and per page full text, each field with its page, position and confidence.

## Output

A JSON object containing: extracted header fields, tables represented as arrays of rows and columns, key-value pairs found in the document, and per-page full text — each field annotated with its page number, bounding-box position on the page, and a confidence score. If a custom schema was provided, returns mapped values per schema property with confidence and source; optionally also returns the raw header/table/kv data alongside if include_raw is true.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "Public http or https URL of the PDF. Use this or \"pdf_base64\", not both."
  },
  "pages": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "integer",
      "minimum": 1
     }
    }
   ],
   "description": "Optional page range, for example \"1-5\", \"2,4,7\" or [1,2,3]. At most 20 pages per call."
  },
  "schema": {
   "type": "object",
   "description": "Optional JSON Schema. Every property is looked up in the document and returned with value, confidence and source. A property that is not in the document stays empty."
  },
  "pdf_base64": {
   "type": "string",
   "description": "The PDF as base64. Use this or \"url\", not both."
  },
  "include_raw": {
   "type": "boolean",
   "default": false,
   "description": "With a schema, also return header data, tables and key value pairs alongside the mapped result."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/document-extraction-hub-pdf-to-structured-json-5deeea64/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from doc.halowerk.com](https://www.zero.xyz/host/doc.halowerk.com/llms.txt)
