# dotrockets PDF to Text Extractor (x402)

> dotrockets PDF to Text Extractor (x402) is a paid API for AI agents from x402.dotrockets.com, paid per call via x402, $0.06/call, status unknown (last checked 2026-10-13).

Fetches a PDF from a URL and extracts its text content, using OCR if needed, returning the extracted text and character count.

## Facts

- Endpoint: GET https://x402.dotrockets.com/v1/pdf?utm_source=zero.xyz
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dotrockets-pdf-to-text-extractor-x402-f97f5d79
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yPJn8X6M5NVuKXvYa2vvu

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 dotrockets-pdf-to-text-extractor-x402-f97f5d79
```

Example prompt: Can you grab the text from this PDF — https://example.com/report.pdf — extracting up to 5 pages, and use OCR automatically if needed?

## When to prefer this

Use this endpoint when you need to extract readable text from a remote PDF file, especially when the PDF may be image-based or scanned (OCR support). Ideal for AI agents that need to process PDF documents without managing API keys — pay per call in USDC via x402 on Base.

## Known failure modes

- Invalid or unreachable PDF URL returns an error
- PDF has more pages than maxPages limit — only first N pages extracted
- OCR disabled but PDF is image-only — may return empty or minimal text
- Payment failure via x402 if USDC balance is insufficient
- PDF is password-protected or corrupted — extraction fails
- maxPages out of range (not 1-10) may return validation error

## How this service works

Machine-payable APIs for AI agents over x402: cosmic live data, AI-visibility scoring, website screenshots, and scrape-to-markdown. Pay per call in USDC on Base. No API keys, no signup.

## Output

Returns a JSON object with the extracted text string, the total character count, and the method used (either 'text' for native PDF text extraction or 'ocr' for optical character recognition).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "ocr": {
   "type": "string",
   "description": "auto (Default), 0 = nie, 1 = erzwingen"
  },
  "url": {
   "type": "string",
   "description": "https://…/datei.pdf"
  },
  "maxPages": {
   "type": "number",
   "description": "1-10 (Default 5)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string"
  },
  "chars": {
   "type": "number"
  },
  "method": {
   "type": "string",
   "description": "text | ocr"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dotrockets-pdf-to-text-extractor-x402-f97f5d79/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.dotrockets.com](https://www.zero.xyz/host/x402.dotrockets.com/llms.txt)
