PDF Data Extraction

Extract structured data from a PDF supplied as a URL or file. Returns JSON fields shaped by your instructions.

Pay by wallet (x402) AI-generated pdf-extract

Example

Input
{
  "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
}
Answer
{
  "data": {
    "pages": 1,
    "title": "Dummy PDF file",
    "content": [
      {
        "page": 1,
        "text": "Dummy PDF file"
      }
    ],
    "metadata": {
      "total_pages": 1,
      "has_structured_data": false
    },
    "document_type": "PDF"
  },
  "source_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
}

Inputs

FieldTypeRequiredWhat it is
urlstringNoURL to a PDF file
base64stringNoBase64-encoded PDF
extractstringNoWhat data to extract (natural language)

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
dataobjectAlways (present in every successful answer)
source_urlstringAlways (present in every successful answer)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "pdf-extract",
    "inputs": {
      "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    },
    "max_price_cents": 30
  }'

Limitations

  • Scanned PDFs have lower extraction accuracy

    AI extraction from PDFs — scanned documents (image PDFs) have lower accuracy than native text PDFs

    What to do instead: For scanned documents, use image-to-text on individual pages for better OCR control

  • Protected or encrypted PDFs cannot be processed

    Password-protected or DRM-encrypted PDFs cannot be processed

    What to do instead: Remove password protection before submitting, or extract text using a local PDF library with the document password

  • Input documents are limited to 8 MiB decoded

    Documents supplied by URL or base64 are refused above 8 MiB of decoded data, with a caller_input error naming the input field and no charge. Reduce the document size or split it before submitting.