# Task Relay PDF Text Extractor

> Task Relay PDF Text Extractor is a paid API for AI agents from task-relay-production.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Fetches a public PDF URL and extracts text-layer content page by page, returning structured results with text, page counts, hashes, truncation flags, and warnings.

## Facts

- Endpoint: POST https://task-relay-production.up.railway.app/x402/pdf-text
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/task-relay-pdf-text-extractor-585905ac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MiwFhxb_utJYptgNHVnLx

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 task-relay-pdf-text-extractor-585905ac -d '<json body>'
```

Example prompt: Can you fetch this PDF at https://example.com/report.pdf and extract all the text from it page by page so I can index it?

## When to prefer this

Choose this endpoint when you need to programmatically extract raw text from a publicly accessible PDF URL for downstream ingestion, indexing, or transformation workflows. It is specifically suited for text-layer PDFs (not scanned images) and returns structured metadata (page count, hash, truncation flags) alongside the text. Prefer this over generic scraping when the source is a PDF file and you need per-page structure and status signals.

## Known failure modes

- PDF URL is not publicly accessible — returns an error or unreachable status
- PDF is a scanned image-only document with no text layer — returns status 'no_text'
- PDF is password-protected or encrypted — extraction fails
- PDF URL is malformed or does not point to a valid PDF — returns an error
- Text content exceeds size limits — truncation flag is set and partial text is returned
- Network timeout fetching the remote PDF URL

## How this service works

When a machine needs plain text from a public PDF URL for ingestion or indexing, Task Relay fetches the PDF and extracts text-layer content page by page into a statused result with text, page counts, hashes, truncation flags, and warnings. Text-layer extraction only; NO OCR; no summarization; scanned image-only PDFs may return status no_text.

## Output

Returns a structured result containing: extraction status (e.g. success, no_text), extracted text content per page, total page count, content hash, truncation flags indicating if content was cut off, and any warnings (e.g. if the PDF is scanned image-only and has no text layer).

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "Public HTTP or HTTPS URL of a PDF for text-layer extraction only (no OCR; size/page/text caps enforced)"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "task_id",
      "task_status",
      "result",
      "error"
     ],
     "properties": {
      "error": {
       "type": [
        "string",
        "null"
       ]
      },
      "result": {
       "type": [
        "object",
        "null"
       ],
       "properties": {
        "text": {
         "type": "string"
        },
        "pages": {
         "type": "array"
        },
        "source": {
         "type": "object"
        },
        "status": {
         "enum": [
          "extracted",
          "partial",
          "no_text",
          "invalid_pdf",
          "encrypted",
          "fetch_error",
          "unknown"
         ],
         "type": "string"
        },
        "document": {
         "type": "object"
        },
        "warnings": {
         "type": "array"
        },
        "final_url": {
         "type": "string"
        },
        "elapsed_ms": {
         "type": "integer"
        },
        "processed_at": {
         "type": "string"
        },
        "requested_url": {
         "type": "string"
        },
        "billable_units": {
         "type": "integer"
        }
       }
      },
      "task_id": {
       "type": "string"
      },
      "task_status": {
       "enum": [
        "succeeded",
        "failed"
       ],
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/task-relay-pdf-text-extractor-585905ac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from task-relay-production.up.railway.app](https://www.zero.xyz/host/task-relay-production.up.railway.app/llms.txt)
