Guide · Receipt OCR

Receipt OCR API: Extract Structured Data from Receipts in One API Call

By Othmane M., founder of DocuParse API

2026-05-20 · 8 min readLast updated: 2026-10-27

If your application needs to read receipts — expense apps, loyalty programs, bookkeeping tools, corporate spend management — you'll eventually evaluate receipt OCR APIs. This guide explains what they actually do, where they differ from each other, and how to pick the right one for your use case.

1
endpoint
AI
checked results
Any
JPG, PNG, PDF
Free
20/month
How It Works

What a Receipt OCR API Does

Real receipt → Real output
Receipt image — any format, any vendor
Sample receipt
Structured JSON — one endpoint
json responseAI-checked result
merchant"Grove Market"
date"2026-05-14"
total"37.59"
tax"2.86"
currency"USD"
receipt_id"GVR-20260514-0391"
payment_method"Visa **** 3812"
line_items[{ description, amount }]
✓ No parsing. Access data['merchant'] directly.

Any receipt format → structured JSON. No templates.

A receipt OCR API accepts a receipt image or PDF and returns structured data — merchant name, transaction date, total amount, individual line items, currency, and tax — as a JSON object.

The key word is structured. A generic OCR engine returns raw text: a disorganized string of characters it found in the image. A receipt OCR API interprets that text into named fields. The difference between "Starbucks\n2026-05-10\n12.75" and { "merchant": "Starbucks", "date": "2026-05-10", "total": "12.75" } is what makes a receipt API genuinely useful — you get data you can store, process, and display without writing interpretation logic.

Fields

The Fields a Good Receipt OCR API Should Return

Not all receipt APIs return the same fields. At minimum, you should expect:

  • merchant — store or vendor name
  • date — transaction date (ISO format if the API is well-designed)
  • total — final charged amount
  • subtotal — pre-tax total
  • tax — tax amount
  • currency — ISO 4217 code (USD, EUR, GBP, etc.)
  • line_items — individual items with description, quantity, and price

Better APIs also return:

  • tax_rate — calculated percentage
  • receipt_id — the receipt's own identifier
  • payment_method — card type, cash, etc.
  • merchant_address — useful for mileage/location tracking

DocuParse API returns all of the above. You can see the full receipt OCR API field reference.

Under the Hood

How Receipt OCR APIs Work (Without the Marketing)

There are two dominant technical approaches:

Traditional OCR + rules: The API runs an OCR pass to extract text, then applies pattern matching — regex for dates, price patterns for totals, position heuristics for merchant names. Fast and reliable for standard layouts; brittle when receipt formats deviate from expectations. Docparser works this way.

AI/ML extraction: A trained model directly interprets the document — understanding layout, context, and semantic meaning — rather than just extracting text. Handles more format variation, scanned images, and unusual layouts. Slower in some cases, but more robust. DocuParse API uses a hybrid: rule-based extraction first, then an AI review of every document that corrects what the rules got wrong.

Both approaches have a place. For a consistent set of receipts from known vendors, rules work fine and are cheaper. For consumer-submitted receipts from arbitrary retailers in arbitrary formats, ML-based extraction is more reliable.

How to Choose

Choosing a Receipt OCR API: What Actually Matters

Pricing model

This matters more than most developers realize at evaluation time.

  • Per document: You pay once per document (up to 10 pages on DocuParse API). Predictable.
  • Per page: A 5-page PDF costs 5× as much as a one-page receipt. AWS Textract and Mindee use the per-page model.
  • Per transaction with a minimum: Veryfi charges $0.08/receipt but requires a $500/month minimum. If you're processing under 6,250 receipts a month, you're paying for capacity you don't use.

For multi-page receipts and PDF bundles, per-document pricing is usually cheaper. DocuParse API bills per document on the Starter plan (see current pricing).

Free tier quality

A real free tier lets you build, test, and validate the integration before committing money. The best free tiers are monthly recurring, not lifetime-limited.

  • DocuParse API: 20 documents/month, recurring, no credit card
  • Mindee: 14-day trial (credit-based plans)
  • Veryfi: Veryfi's Free plan covers up to 100 documents a month.
  • Docparser: 14-day trial, then minimum $39/month

Response format

Your application should be able to use the API response directly without post-processing. If you're writing a translation layer to go from the API's output format to your data model, the API isn't well-designed. Look for:

  • Named fields (not bounding boxes or confidence arrays)
  • Consistent types (not sometimes a string, sometimes a number for total)
  • Explicit null for missing fields rather than omitting them

Setup complexity

The best receipt OCR APIs require an API key and one endpoint. That's it. Watch out for:

  • Requiring template setup per receipt type
  • Requiring a machine learning model training step
  • Requiring cloud platform credentials (AWS IAM, GCP service accounts)
Try it on your own receipt — no account needed
Upload a receipt image or PDF. See the named JSON fields it returns.
Open Live Demo →
Free tier · 20 documents/month — free forever · No credit card · No account needed for the demo
Python · Node.js

Quick Start: Receipt OCR in Under 5 Minutes

Here's the minimum viable receipt extraction request using DocuParse API:

bash · 9 lines
# 1. Submit the document
curl -X POST https://docuparseapi.com/api/v1/extract \
  -H "Authorization: Bearer $DOCUPARSE_API_KEY" \
  -F "file=@receipt.jpg"
# → {"success": true, "document_id": "<id>", "status": "queued"}

# 2. Fetch the result (repeat until "status" is "completed" or "failed")
curl https://docuparseapi.com/api/v1/documents/<id> \
  -H "Authorization: Bearer $DOCUPARSE_API_KEY"

When the status is completed, the result's data object looks like this (sample invoice — receipt examples coming soon):

json · 72 lines
{
  "document_type": "invoice",
  "document_number": "31293737",
  "invoice_id": "31293737",
  "receipt_id": null,
  "date": "2020-12-15",
  "due_date": null,
  "currency": "USD",
  "merchant": "Nunez Inc",
  "merchant_address": "6551 Janet Gardens, Michaelberg, KS 90952",
  "merchant_email": null,
  "customer": "Alvarez Inc",
  "subtotal": "371.51",
  "tax": "37.15",
  "tax_rate": "10.00",
  "discount": null,
  "shipping": null,
  "total": "408.66",
  "payment_method": null,
  "notes": null,
  "line_items": [
    {
      "description": "Women's black cocktail dress, size 4",
      "quantity": 3,
      "price": "19.99",
      "line_total": "59.97",
      "vat_rate": "10.00"
    },
    {
      "description": "Christmas Dress Grace Karin Sleeveless Christmas dress Red Black size Large",
      "quantity": 1,
      "price": "9.99",
      "line_total": "9.99",
      "vat_rate": "10.00"
    },
    {
      "description": "Windsor womens black and Pink Bodycon Sleeveless Dress, Womens Size Small",
      "quantity": 1,
      "price": "15.83",
      "line_total": "15.83",
      "vat_rate": "10.00"
    },
    {
      "description": "Lumiere Large Multicolored Orange Short Dress NWT",
      "quantity": 4,
      "price": "4.99",
      "line_total": "19.96",
      "vat_rate": "10.00"
    },
    {
      "description": "Xhilaration Womens L Burgandy Boho Embroidered Festival Mini Dress NEW",
      "quantity": 4,
      "price": "14.95",
      "line_total": "59.80",
      "vat_rate": "10.00"
    },
    {
      "description": "Johnny Was Medium Linen Wrap Dress Dessert Rose Embroiderd Bohemian",
      "quantity": 2,
      "price": "89.99",
      "line_total": "179.98",
      "vat_rate": "10.00"
    },
    {
      "description": "Pre-Owned Women's Nah Nah Dress Size 8 Black Sheer Formal Sexy",
      "quantity": 2,
      "price": "12.99",
      "line_total": "25.98",
      "vat_rate": "10.00"
    }
  ]
}

That's the complete output. No post-processing needed. Map the fields directly to your data model.

On Starter and Pro you can skip polling: add a webhook in Dashboard → Settings and DocuParse API will POST the finished result to your endpoint.

Python · Node.js
import os, time, requests

API = "https://docuparseapi.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DOCUPARSE_API_KEY']}"}

def parse_document(path: str) -> dict:
    # 1. Submit
    with open(path, "rb") as f:
        submit = requests.post(f"{API}/extract", headers=HEADERS,
                               files={"file": (os.path.basename(path), f)}, timeout=30).json()
    if not submit.get("success"):
        raise RuntimeError(f"[{submit['error']['code']}] {submit['error']['message']}")

    # 2. Fetch the result
    for _ in range(40):
        doc = requests.get(f"{API}/documents/{submit['document_id']}",
                           headers=HEADERS, timeout=30).json()
        if doc["status"] == "completed":
            return doc["data"]
        if doc["status"] == "failed":
            raise RuntimeError(f"Extraction failed: {submit['document_id']}")
        time.sleep(1.5)
    raise TimeoutError(submit["document_id"])

data = parse_document("receipt.jpg")
print(data["merchant"], data["total"], data["currency"])
The code above is ready to run on your receipts.
20 receipts/month free, no credit card.
Edge Cases

Common Receipt OCR Challenges and How They're Handled

Thermal paper fading: Older receipts on thermal paper often fade. A good ML-based extraction layer handles contrast enhancement and partial text recovery better than pure OCR.

Mobile phone photos: Camera angle, shadows, and perspective distortion are common in user-submitted receipt photos. The extraction pipeline normalizes this before attempting to read fields.

Foreign languages and currencies: A well-trained receipt model handles multi-language receipts and returns the currency as an ISO code regardless of the symbol on the original document.

Missing fields: Not every receipt has a loyalty number or payment method. The API should return null for missing fields rather than omitting them — this makes your code simpler because you don't need to check for key existence.

When to Use vs. Not Use a Receipt OCR API

Use a receipt OCR API when:

  • You're building an application where users submit their own receipts (expense apps, reimbursement tools, loyalty programs)
  • Your invoice volume is too high for manual entry but too low to justify building extraction infrastructure
  • You need line-item detail, not just totals

Don't use a receipt OCR API when:

  • You're processing fewer than 5 receipts a month — manual entry is simpler
  • You need to extract data from proprietary or highly structured documents that don't resemble standard receipts (use a document processing API instead)

Next Steps

Your receipts are still unstructured data.

One endpoint changes that. 20 documents/month — free forever, any format.

More from the blog

All posts →