Skip to main content
Parse & classify

Build a parser for any document.

Define your own field schema and extract exactly what you need, or let PDF4me classify mixed batches and route each file by type. This is the custom engine. Ready-made invoice and receipt parsers live on AI data extraction.

Parse Document

Extract exactly the fields you name.

Parse Document is the universal AI endpoint. Provide a document and a parse definition; receive JSON keyed by your field schema. Native actions in Power Automate, Make and n8n.

The schema

Four keys describe any field.

  • Describe the fields. Write a parse definition: each field has a fieldName, a fieldType and a plain-language fieldDescription. Or build the same schema as a Parse Analyzer in the dashboard.
  • POST the document. Send Base64 docContent with docName to /api/v2/ParseDocument, plus your Analyzer Id or parse definition.
  • Read the JSON. The response carries parsedData keyed to your schema, plus documentType and pageCount.
  • fieldName is the JSON key you get back.
  • fieldType is string, number, date, or table for repeating rows.
  • fieldDescription is the plain-language hint. List alternate labels for accuracy.
  • fieldMethod is optional: extract takes the value as printed, generate derives or normalises it.
parse-document.sh
curl -X POST https://api.pdf4me.com/api/v2/ParseDocument \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "docContent": "<base64 pdf>",
    "docName": "form.pdf",
    "AnalyzerId": "custom_form_parser",
    "async": false
  }'

Parse Document REST docs

Classify Document

Know the type before you parse it.

Classify Document predicts whether a file is an invoice, contract, receipt or another type, with a confidence score. Use it to sort a mixed batch, then parse each file by type.

The verdict

One POST, type plus confidence.

  • POST the document. Base64-encode the PDF and send it as docContent with a docName to /api/v2/ClassifyDocument.
  • Read the verdict. The response returns documentType, category and a confidence score between 0.0 and 1.0.
  • Branch, then parse. Route high-confidence files to the matching parser. Queue low-confidence ones for review. For mixed inboxes, a Classify Analyzer can route and extract in one call.
documentType confidence 0.0–1.0 POST /ClassifyDocument
classify-document.sh
curl -X POST https://api.pdf4me.com/api/v2/ClassifyDocument \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "docContent": "<base64 PDF>",
    "docName": "incoming.pdf"
  }'
Dashboard analyzers

Build the schema once, call it everywhere.

A Parse Analyzer or Classify Analyzer in the dashboard gives you a stable Analyzer Id for the REST API, Power Automate, Make, n8n and Zapier. Custom forms that are not in the ready-made set live here.

Get your documents done.

Build it into your product with the API, automate it with no code, or use the free tools in your browser. No credit card to begin.

Start with a single callcurl -X POST https://api.pdf4me.com/v1/ConvertToPdf

Free tier · No credit card required