# d21 PDF Extract

> d21 PDF Extract is a paid API for AI agents from draconic21-x402-api.onrender.com, paid per call via x402, $0.04/call, status unknown (last checked 2026-10-12).

Extracts per-page plain text and metadata from a PDF using embedded text objects (no OCR, no third-party vendor), returning structured page-by-page content.

## Facts

- Endpoint: POST https://draconic21-x402-api.onrender.com/v1/pdf_extract?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/d21-pdf-extract-383db01b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DvlwWixoABf4WuO5yB0KL

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 d21-pdf-extract-383db01b -d '<json body>'
```

Example prompt: Pull all the text out of this PDF for me — here's the link: https://example.com/report.pdf — extract up to 40 pages and give me the plain text content page by page.

## When to prefer this

Choose this endpoint when you need fast, deterministic text extraction from PDFs that contain embedded text (not scanned images). It is ideal when you want no dependency on third-party OCR or PDF vendors, need per-page text breakdown, and the source PDF is under 10 MiB and 40 pages. If your PDF consists entirely of scanned images, you will need an OCR-capable alternative instead.

## Known failure modes

- PDF exceeds 10 MiB limit — request rejected
- PDF has more than 40 pages — capped or rejected depending on max_pages
- PDF URL is not publicly accessible or blocked by SSRF protection — fetch fails
- PDF contains only scanned images with no embedded text — returns empty or sparse text per page
- Both url and pdf_base64 provided simultaneously — request rejected as mutually exclusive
- Invalid base64 encoding — decoding error returned
- PDF is password-protected or encrypted — parsing fails
- Service unavailable — check /v1/pdf_extract/availability endpoint first

## How this service works

PDF Extract ($0.04): deterministic PDF -> per-page plain text + metadata, no OCR, no table extraction, no third-party PDF/OCR vendor -- text pulled directly from the PDF's own embedded text objects via pdfjs-dist (Mozilla's own PDF.js, Apache-2.0) running in this process. Body { url } (public http(s) PDF link, SSRF-hardened fetch) OR { pdf_base64 } (raw base64 bytes), not both. Max 10 MiB, max 40 pages. Check free /v1/pdf_extract/availability first.

## Output

Returns structured JSON with per-page plain text content and PDF metadata (such as title, author, page count), with one entry per page up to the requested or default maximum of 40 pages. No OCR is performed; only text embedded directly in the PDF's own text objects is returned.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Public http(s) link to a PDF. Mutually exclusive with pdf_base64."
  },
  "max_pages": {
   "type": "integer",
   "description": "Optional; defaults to 40 (the route's own cap). Capped at 40 regardless of the value passed."
  },
  "pdf_base64": {
   "type": "string",
   "description": "Raw PDF bytes, base64-encoded. Mutually exclusive with url. Max 10 MiB decoded."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/d21-pdf-extract-383db01b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from draconic21-x402-api.onrender.com](https://www.zero.xyz/host/draconic21-x402-api.onrender.com/llms.txt)
