# PDF to Markdown/HTML/JSON Converter (Datalab Marker)

> PDF to Markdown/HTML/JSON Converter (Datalab Marker) is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.2/call, status unknown (last checked 2026-09-13).

Converts PDF documents to markdown, HTML, or structured JSON with OCR-grade text extraction and structure preservation, up to 30 pages per call.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/pdf-to-markdown
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-6743e26f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_L1QXBG-p9AVSQOIcdXJU_

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 x402-deployer-x402-deployer-workers-dev-6743e26f -d '<json body>'
```

Example prompt: Can you convert this PDF to markdown for me? Here's the file — it's a 20-page research report and I need clean markdown output with the headings and structure preserved.

## When to prefer this

Use this endpoint when you need high-quality, structure-preserving PDF text extraction with OCR capabilities, especially for research papers, reports, or scanned documents. Prefer this over generic text extraction when document structure (headings, tables, sections) matters in the output. Best for single documents up to 30 pages where OCR-grade accuracy is needed.

## Known failure modes

- PDF exceeds 30-page limit — returns error indicating page limit exceeded
- Corrupted or password-protected PDF — returns parsing error
- Unsupported output format requested — returns validation error
- Network timeout for large PDFs — returns timeout error
- Payment not provided or insufficient — returns 402 payment required

## How this service works

PDF parser / PDF to Markdown / PDF to text / OCR PDF / extract tables from PDF / scanned-PDF OCR / PDF reader / PDF data extractor / equation-aware PDF parser / Datalab Marker. AI-powered, layout-aware extraction that preserves headings, tables, equations (LaTeX), bulleted lists, and multi-column flow. Outputs Markdown (default), HTML, or structured JSON with per-page blocks. Handles digital + scanned PDFs. 30 pages max.

## Output

Returns the document content in the requested format (markdown, HTML, or structured JSON), with headings, paragraphs, tables, and other structural elements preserved from the original PDF. OCR-quality extraction handles both native and scanned PDFs up to 30 pages.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "pdf_url": {
       "type": "string",
       "description": "Public URL of a PDF file (http or https). Must be directly fetchable, not behind auth or a viewer redirect. Max 30 pages."
      },
      "output_format": {
       "type": "string",
       "enum": [
        "markdown",
        "html",
        "json"
       ],
       "description": "'markdown' (default — best for LLM downstream), 'html' (preserves more layout structure), or 'json' (per-page blocks with type + bbox)."
      }
     },
     "required": [
      "pdf_url"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "markdown": {
       "type": "string"
      },
      "page_count": {
       "type": "integer"
      },
      "source_url": {
       "type": "string"
      }
     }
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-6743e26f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
