# Document Extraction API (PDF, DOCX, CSV to Markdown + JSON)

> Document Extraction API (PDF, DOCX, CSV to Markdown + JSON) is a paid API for AI agents from api.webbersites.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Fetches a PDF, DOCX, or CSV document by public URL and returns clean Markdown plus structured JSON with metadata

## Facts

- Endpoint: GET https://api.webbersites.com/api/extract
- 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-api-pdf-docx-csv-to-markdown-json-87f7844c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KhJxwfRGo4jy-IFby8_NT

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-api-pdf-docx-csv-to-markdown-json-87f7844c
```

Example prompt: Can you extract the text and structured data from this PDF at https://example.com/report.pdf and give me the content page by page as Markdown?

## When to prefer this

Use this endpoint when an AI agent needs the actual readable contents of a remote PDF, DOCX, or CSV document — not raw bytes. Ideal when you have a public URL and want clean Markdown for LLM consumption or structured JSON rows/columns for data processing. Prefer over general web scrapers when the target is a document file, and over OCR services when the PDF has embedded text.

## Known failure modes

- URL is not publicly accessible or returns non-200 — fetch error returned
- Document type cannot be detected and no 'type' override provided — parser error
- Scanned PDF with no embedded text — returned with flag indicating OCR is needed, text may be empty
- CSV exceeds max_rows limit — truncated to requested or default 1000 rows
- Malformed or password-protected document — parse error returned
- Non-document URL (e.g. HTML page) provided — type mismatch or error

## How this service works

Document extraction: fetch a PDF, DOCX, or CSV by URL and get clean Markdown plus structured JSON — PDF text by page with metadata (honestly flags scanned PDFs that would need OCR), DOCX converted to real Markdown, CSV parsed to typed columns + JSON rows + a Markdown table. For agents that need document contents, not bytes.

## Output

Returns a JSON object containing: for PDFs — per-page text, total page count, word count, and metadata (with honest flags if scanned/OCR-needed); for DOCX — full Markdown conversion; for CSV — typed column definitions, JSON rows (up to max_rows), row count, and a Markdown table representation. A 'markdown' field is always present for human-readable content.

## 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "Public http(s) URL of the .pdf, .docx, or .csv document"
      },
      "type": {
       "type": "string",
       "description": "Force the parser: pdf, docx, or csv (default: auto-detect from content-type, extension, magic bytes)"
      },
      "max_rows": {
       "type": "number",
       "description": "CSV only: max rows returned as JSON (default 1000, max 5000)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "rows": {
       "type": "array"
      },
      "type": {
       "type": "string"
      },
      "pages": {
       "type": "number"
      },
      "columns": {
       "type": "array"
      },
      "markdown": {
       "type": "string"
      },
      "metadata": {
       "type": "object"
      },
      "row_count": {
       "type": "number"
      },
      "word_count": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com/quarterly-report.pdf",
  "type": "pdf",
  "pages": 12,
  "markdown": "## Page 1\n\nExecutive summary…",
  "metadata": {
   "title": "Q2 Report",
   "author": "Finance Team"
  },
  "word_count": 4120
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/document-extraction-api-pdf-docx-csv-to-markdown-json-87f7844c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.webbersites.com](https://www.zero.xyz/host/api.webbersites.com/llms.txt)
