heey-ocr

Heey OCR for n8n: AI-powered OCR for invoices, receipts, contracts, IDs, bank statements and more β€” returns structured JSON ready to use

Package Information

Released: this month
Downloads: 0 weeklyΒ /Β 0 monthly
Latest Version: 2.0.1
Author: Heey

Documentation

Heey OCR for n8n

N8N Community Node for the Heey OCR Service β€” AI-powered OCR for invoices, receipts, contracts, IDs, bank statements and more β€” returns structured JSON ready to use.

npm version
License: MIT

πŸ’‘ What it does

You hand it a document, it hands you back clean JSON. No regex, no template matching, no per-vendor parser.

  • Invoices β†’ vendor, line items, tax breakdown, totals, IBAN, due date
  • Receipts β†’ merchant, items with per-item tax, payment method
  • Bank statements β†’ account holder, balances, full transaction list
  • Contracts β†’ parties, dates, obligations, governing law, signatures
  • IDs / passports β†’ personal data + MRZ lines
  • Payslips, delivery notes, purchase orders, handwriting β†’ and more

Example: invoice PDF β†’ structured JSON

{
  "vendor": { "name": "ACME GmbH", "vat_id": "DE123456789" },
  "invoice_number": "RE-2024-00842",
  "invoice_date": "2024-03-15",
  "due_date": "2024-04-14",
  "line_items": [
    { "description": "Consulting", "quantity": 8, "unit_price": 150.00, "total": 1200.00 }
  ],
  "subtotal": 1200.00,
  "tax_amount": 228.00,
  "total": 1428.00,
  "iban": "DE89 3704 0044 0532 0130 00"
}

(Every response also includes document_type and a metadata object β€” see Output Examples below for the full shape.)

Drop it into any workflow that needs accounting, expense tracking, KYC, or document classification.

πŸš€ Features

  • Structured Data Extraction: Receive a structured JSON object with the fields relevant to the document type
  • Document Types & Auto Detection: Invoice, Receipt, Contract, Delivery Note, Bank Statement, Payslip, Purchase Order, ID Document, Handwriting, Full-Text, Generic, and automatic type detection (auto)
  • Multiple Format Support: PDF, PNG, JPG, JPEG, WebP, TIFF (up to 100MB)
  • Secure Authentication: API key stored securely using n8n credentials

πŸ“¦ Installation

Community Nodes (Recommended)

  1. Go to Settings β†’ Community Nodes
  2. Click Install a community node
  3. Enter n8n-nodes-heey-ocr
  4. Click Install

Manual Installation

npm install n8n-nodes-heey-ocr

πŸ”§ Configuration

Setting Up Credentials

  1. Get your API key from Heey OCR Dashboard
  2. In n8n, go to Credentials β†’ Add Credential
  3. Search for "Heey OCR API"
  4. Enter your API key and save

πŸ“– Usage

  1. Add the Heey OCR node to your workflow
  2. Connect a node that provides binary data (e.g., Read Binary File, HTTP Request)
  3. Configure:
    • Binary Property: Name of the binary property containing your document (default: data)
    • Document Type: Select the type that matches your document
  4. Execute β€” the node outputs a JSON object with the extracted fields

Document Types

Type Description
generic Flexible extraction for any document β€” adapts structure to the content. Cheap default; pick a specific type below when you know it
invoice Vendor, customer, line items, tax breakdown, totals, IBAN, payment terms
receipt Merchant, items, per-item tax rate, tax breakdown, totals, payment method
contract Parties (role/name/address), dates, obligations, governing law, signatures
delivery_note Sender, recipient, items (ordered vs. delivered), tracking, partial delivery info
bank_statement Account holder, IBAN/BIC, opening/closing balance, full transaction list
payslip Employer, employee (incl. IBAN), earnings, deductions, gross/net salary
purchase_order Buyer, supplier, delivery address, line items, totals
id_document Type, document number, personal data, MRZ lines
handwriting Full transcription with unclear-word markers, confidence rating, language
fulltext Transcribe the entire document as Markdown β€” billed at 10Γ— a structured extraction
auto Classify the document first and then extract β€” costs more than picking a specific type. Use only when the type is genuinely unknown

πŸ“€ Output Examples

Invoice

{
  "vendor": { "name": "ACME GmbH", "address": "Musterstr. 1, 10115 Berlin", "vat_id": "DE123456789" },
  "invoice_number": "RE-2024-00842",
  "invoice_date": "2024-03-15",
  "due_date": "2024-04-14",
  "line_items": [
    { "description": "Consulting Services", "quantity": 8, "unit_price": 150.00, "total": 1200.00 }
  ],
  "subtotal": 1200.00,
  "tax_rate": 19,
  "tax_amount": 228.00,
  "total": 1428.00,
  "iban": "DE89 3704 0044 0532 0130 00",
  "document_type": "invoice",
  "metadata": { "pages": 1 }
}

Receipt

{
  "merchant": { "name": "REWE City", "address": "Friedrichstr. 12, 10117 Berlin" },
  "date": "2024-03-22",
  "items": [
    { "description": "Bioland Γ„pfel 1kg", "quantity": 1, "price": 2.49 },
    { "description": "Mineralwasser 6x1.5L", "quantity": 1, "price": 3.99 }
  ],
  "subtotal": 6.48,
  "tax_breakdown": [{ "rate": 7, "amount": 0.42 }],
  "total": 6.90,
  "payment_method": "EC-Karte",
  "document_type": "receipt",
  "metadata": { "pages": 1 }
}

πŸ“‹ Example Workflow

{
  "nodes": [
    {
      "name": "Read Invoice PDF",
      "type": "n8n-nodes-base.readBinaryFile",
      "parameters": {
        "filePath": "/path/to/invoice.pdf"
      }
    },
    {
      "name": "Extract Invoice Data",
      "type": "n8n-nodes-heey-ocr.heeyOcr",
      "parameters": {
        "binaryPropertyName": "data",
        "documentType": "invoice"
      }
    }
  ]
}

πŸ”’ Supported File Types

Format MIME Type Max Size
PDF application/pdf 100MB
PNG image/png 100MB
JPG/JPEG image/jpeg 100MB
WebP image/webp 100MB
TIFF image/tiff 100MB

πŸ”§ Troubleshooting

"Unsupported file type" error

The node only accepts PDF, PNG, JPG, JPEG, WebP, and TIFF files. Make sure the upstream node sets the correct MIME type. If you're using HTTP Request to download a file, check that the response has a proper Content-Type header.

"File size exceeds maximum allowed size"

The Heey OCR API accepts files up to 100MB. For larger PDFs, consider compressing them first or splitting them into individual pages.

"Connection tested successfully" but processing fails

Your API key is valid, but the key may not have enough quota remaining. Check your usage in the Heey OCR Dashboard.

Node not appearing in n8n's node picker

In n8n 2.x, unverified community nodes are hidden from the picker search. Install the node via Settings β†’ Community Nodes, then add it to your workflow by importing the following JSON snippet:

{
  "type": "n8n-nodes-heey-ocr.heeyOcr",
  "parameters": { "binaryPropertyName": "data", "documentType": "invoice" }
}

Binary property not found

The Binary Property field must match the property name set by the previous node. The default is data (used by Read Binary File, HTTP Request, etc.). Check the output of the previous node to confirm the property name.

πŸ› οΈ Development

Prerequisites

  • Node.js 22+
  • pnpm 11+

Setup

# Clone the repository
git clone https://github.com/Heey-Global/heey-ocr-n8n.git
cd heey-ocr-n8n

# Install dependencies
pnpm install

# Build
pnpm build

# Run tests
pnpm test

# Run linter
pnpm lint

Project Structure

src/
β”œβ”€β”€ credentials/
β”‚   └── HeeyOcrApi.credentials.ts    # API key credential type
β”œβ”€β”€ nodes/
β”‚   └── HeeyOcr/
β”‚       β”œβ”€β”€ HeeyOcr.node.ts          # Main node implementation
β”‚       └── deepocr.svg              # Node icon
β”œβ”€β”€ utils/
β”‚   └── errors.ts                    # Error handling utilities
└── index.ts                         # Package entry point

πŸ“„ License

MIT

🀝 Contributing

Contributions are welcome! Please submit pull requests to our repository.

πŸ“ž Support

Discussion