# switch402 PDF to Text Extractor

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

Fetches a public PDF URL and returns its text content page by page, up to 50 pages or 10 MB.

## Facts

- Endpoint: GET https://api.switch402.com/v1/pdf?utm_source=zero.xyz
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/switch402-pdf-to-text-extractor-61af97cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CTa6-4RdtjU4gnzHHwBEJ

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 switch402-pdf-to-text-extractor-61af97cd
```

Example prompt: Can you extract the text from this PDF for me — https://example.com/report.pdf — just pages 1 through 5?

## When to prefer this

Choose this endpoint when you have a publicly accessible PDF URL and need its text content extracted page by page. Ideal for processing documents, reports, contracts, invoices, or research papers where the PDF has embedded (not scanned) text. Prefer this over screenshot or scrape endpoints when the source is definitively a PDF file and you need machine-readable text rather than visual output.

## Known failure modes

- PDF URL is not publicly accessible or requires authentication — returns an error
- PDF exceeds 10 MB size limit — rejected
- More than 50 pages requested — capped or rejected
- PDF is image-based or scanned with no embedded text — returns empty or minimal text
- Invalid or malformed URL provided — returns an error
- PDF is password-protected — extraction fails

## How this service works

switch402 PDF to text: a public PDF URL in, its text page by page out (up to 50 pages, 10 MB). Charged only when text comes back.

## Output

A page-by-page breakdown of the PDF's text content, structured as an object with each page's extracted text. Only returned (and charged) when text is successfully extracted.

## 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",
       "maxLength": 2048,
       "description": "Public http(s) URL of a PDF (up to 10 MB)"
      },
      "pages": {
       "oneOf": [
        {
         "type": "array",
         "items": {
          "type": "integer",
          "maximum": 10000,
          "minimum": 1
         },
         "maxItems": 50,
         "minItems": 1
        },
        {
         "type": "string",
         "maxLength": 400
        }
       ],
       "description": "Optional page numbers, up to 50: an array like [1, 2] or a string like \"1-3,7\" (default: from page 1, up to 50 pages)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

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