CRATEAPI

API Reference

Full endpoint list for both CrateAPI products: curl examples, responses, authentication, limits. Endpoint paths, curl examples, parameter and profile names, and JSON payloads stay in English throughout - copy-pasteable code shouldn't need translating.

Authentication

E-invoicing base URL: https://api.crateapi.com/v1. Document tools base URL: https://api.crateapi.com (paths /pdf, /screenshot, /email, /extract). Send your key as X-API-Key: <your key>. Endpoints marked free need no key at all - that's deliberate, not a trial: validation stays free forever.

curl -X POST https://api.crateapi.com/v1/validate/ubl \
     -H "Content-Type: application/xml" \
     --data-binary @invoice.xml

{"profile":"peppol","valid":true,"counts":{"fatal":0,"warning":0},"findings":[],"duration_ms":12}
curl -X POST https://api.crateapi.com/v1/generate/ubl?profile=peppol \
     -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
     -d @invoice.json -o invoice.xml

E-Invoicing API

EN 16931: UBL/Peppol BIS, CII, Factur-X, FatturaPA (Italy: TD01/TD04/TD05 invoices and credit/debit notes, Natura codes incl. forfettario), Order-X (purchase orders). Full OpenAPI spec: /openapi.json · interactive docs: /docs (Swagger UI).

EndpointAuthNotes
POST /v1/validate/ublfreeValidate a UBL invoice. `profile`: en16931, peppol, xrechnung, ro, fr, fr-extended.
POST /v1/validate/ciifreeValidate a CII invoice. `profile`: en16931, xrechnung, fr, fr-extended.
POST /v1/validate/facturapafreeFatturaPA XSD-structural validation only (no official schematron ruleset exists to vendor).
POST /v1/validate/orderxfreeOrder-X Basic - full XSD + official schematron validation.
POST /v1/pdfa/validatefreePDF/A validation (veraPDF). `flavour`: auto|1a|1b|2a|2b|2u|3a|3b|3u|4|4e|4f.
GET /validatorfreeIn-browser drag-and-drop validator, same engine, no signup.
POST /v1/generate/ublneeds X-API-KeyJSON invoice model → UBL XML. `profile`: en16931, peppol, xrechnung, ro.
POST /v1/generate/ciineeds X-API-KeyJSON invoice model → CII XML. `profile`: en16931, xrechnung.
POST /v1/generate/facturxneeds X-API-KeyOur minimal visual PDF + embedded CII XML (EN16931).
POST /v1/generate/facturx/embedneeds X-API-KeyYour branded PDF + invoice JSON → PDF/A-3 with embedded CII (multipart).
POST /v1/generate/facturapaneeds X-API-KeyItaly FatturaPA XML: TD01 invoices, TD04/TD05 credit/debit notes, Natura VAT-exemption codes (incl. forfettario N2.2), optional ritenuta/bollo/cassa.
POST /v1/generate/orderxneeds X-API-KeyOrder-X Basic purchase order XML (not an invoice).
POST /v1/convert/ubl-to-ciineeds X-API-KeyLossless-or-rejected: 422 with details rather than a silent degrade.
POST /v1/convert/cii-to-ublneeds X-API-KeySame guarantee, other direction.
POST /v1/render/htmlneeds X-API-KeyInvoice XML → human-readable HTML (official KoSIT visualization).
POST /v1/render/pdfneeds X-API-KeyInvoice XML → PDF. `style`: compact (default, 1-page) or kosit (audit form).
POST /v1/pdfa/convertneeds X-API-KeyAny PDF → PDF/A-3b, with optional embedded files.
POST /v1/pdfa/consistencyneeds X-API-KeyFactur-X: does the embedded XML agree with the PDF's visible text?
POST /v1/repair/ublneeds X-API-KeyBest-effort auto-repair: non-ISO dates, totals arithmetic drift.
POST /v1/repair/ciineeds X-API-KeySame, CII syntax.

Document Tools API

PDF, screenshot, email validation, content extraction. Auth: via RapidAPI (listing pending) or contact us for direct access. Per-API specs: /pdf/openapi.json, /screenshot/openapi.json, /email/openapi.json, /extract/openapi.json.

APIEndpointNotes
pdfPOST /pdf/mergeCombine 2+ PDFs, in upload order.
pdfPOST /pdf/splitExtract pages, e.g. `pages=1-3,5`.
pdfPOST /pdf/watermarkDiagonal text overlay - `text`, `opacity`, `color`, `font_size`.
pdfPOST /pdf/protectAES-256 password encryption.
pdfPOST /pdf/compressGhostscript recompression - `level`: low|medium|high; never returns a bigger file than the input.
pdfPOST /pdf/from-htmlRaw HTML → PDF (headless Chromium).
pdfPOST /pdf/from-urlPublic URL → PDF, same anti-SSRF guard as /screenshot.
pdfPOST /pdf/to-imagesPages → PNG/JPEG, returned as a ZIP.
pdfPOST /pdf/extract-textLayout-aware text extraction (poppler, pypdf fallback).
pdfPOST /pdf/metadataPage count, encryption flag, document info fields.
screenshotGET /screenshot/takeURL → PNG/JPEG. `block_ads`, `block_trackers`, `block_cookie_banners`, `cache_ttl`, `full_page`, `delay_ms`.
emailGET /email/validateSyntax + MX + disposable + role-account + free-provider signals, with a score.
emailPOST /email/validate-batchUp to 100 addresses, JSON body.
emailPOST /email/validate-bulkCSV upload, up to 5,000 addresses; `format=json` or `format=csv` (results appended).
extractGET /extract/articleURL → clean article text + metadata, boilerplate removed.
extractPOST /extract-htmlRaw HTML → clean text (no fetch).

Limits

E-invoicing: XML body capped at 2 MB, PDF uploads at 10 MB. Monthly quota per key (calibrated per plan, generous default - see pricing) applies to every endpoint except /validate/* and /pdfa/validate, which stay unmetered.

Document tools: 100 requests/month on the free plan, up to 50,000/month on Ultra - see pricing. Bulk email validation caps at 5,000 addresses / 2 MB per upload.

MCP server (AI agents)

Self-hosted, works today with your own API key - no need to wait for a hosted endpoint:

{"mcpServers": {"crateapi-einvoicing": {
    "command": "python", "args": ["-m", "einvoicing.mcp_server"],
    "env": {"EINVOICE_API_KEY": "your-key-here"}}}}

Tools: validate_invoice (free), repair_invoice, generate_invoice, convert_invoice. Machine-readable summary of this whole page: /llms.txt · /ai (JSON).