Building an expense management app? Automating bookkeeping? Or adding receipt scanning to your mobile app? A receipt scanner API lets you extract structured data from any receipt photo or PDF in seconds. In this developer guide, you'll learn how to integrate Eagle Doc's Receipt OCR API into your application — from authentication to handling the JSON response.
A receipt scanner API is a cloud-based service that accepts receipt images (JPEG, PNG) or PDFs and returns structured data in JSON format. Unlike generic OCR which only returns raw text, a receipt-specific API understands the layout of receipts and extracts named fields like merchant name, date, total, tax, currency, payment method, and individual line items with their prices and quantities.
Eagle Doc's receipt extraction API is purpose-built for production use:
Getting started with Eagle Doc's Receipt OCR API takes just a few lines of code. Choose your preferred language:
curl -X POST "https://de.eagle-doc.com/api/receipt/v3/processing" \
-H "api-key: YOUR_API_KEY" \
-F "file=@receipt.jpg"
import requests
url = "https://de.eagle-doc.com/api/receipt/v3/processing"
payload = {}
files=[
('file',('receipt.jpeg',open('receipt.jpeg','rb'),'image/jpeg'))
]
headers = {
'api-key': 'YOUR_SECRET_API_KEY'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
import java.net.http.*;
import java.net.*;
import java.nio.file.*;
import java.io.*;
import java.nio.charset.StandardCharsets;
public class ExampleReceipt {
public static void main(String[] args) throws IOException, InterruptedException {
var apiKey = "API-KEY-xxxxxx";
var boundary = "----EagleDocBoundary" + System.currentTimeMillis();
// Read the jpg file as bytes (binary)
byte[] fileBytes = Files.readAllBytes(Path.of("receipt.jpeg"));
// Build multipart body with binary support
var outputStream = new ByteArrayOutputStream();
var writer = new PrintWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8), true);
// File part
writer.append("--").append(boundary).append("\r\n");
writer.append("Content-Disposition: form-data; name=\"file\"; filename=\"receipt.jpeg\"\r\n");
writer.append("Content-Type: image/jpeg\r\n\r\n");
writer.flush();
outputStream.write(fileBytes);
outputStream.flush();
writer.append("\r\n");
// End boundary
writer.append("--").append(boundary).append("--\r\n");
writer.flush();
byte[] body = outputStream.toByteArray();
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://de.eagle-doc.com/api/receipt/v3/processing"))
.header("api-key", apiKey)
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.POST(HttpRequest.BodyPublishers.ofByteArray(body))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
The API returns a structured JSON object. Here's an abbreviated example of what you'll receive:
{
"general": {
"ShopName": {
"value": "dm-drogerie markt",
"page": 1,
"confidence": 1.0
},
"ShopStreet": {
"value": "Hertzstraße 9",
"page": 1,
"confidence": 1.0
},
"ShopCity": {
"value": "Vaihingen an der Enz",
"page": 1,
"confidence": 1.0
},
"ShopZip": {
"value": "71665",
"page": 1,
"confidence": 1.0
},
"ShopCountry": {
"value": "DE",
"confidence": 1.0
},
"TotalPrice": {
"value": "34.7",
"page": 1,
"confidence": 1.0
},
"TaxAmount": {
"value": "4.44",
"confidence": 1.0
},
"TaxGrossAmount": {
"value": "34.7",
"page": 1,
"confidence": 1.0
},
"TaxNetAmount": {
"value": "30.26",
"confidence": 1.0
},
"InvoiceDate": {
"value": "2021-02-23",
"page": 1,
"confidence": 1.0
},
"InvoiceNumber": {
"value": "0319/1 218506/12 3815",
"page": 1,
"confidence": 1.0
},
"TaxNumber": {
"value": "34092/30007",
"page": 1,
"confidence": 1.0
},
"VATNumber": {
"value": "34092/30007",
"page": 1,
"confidence": 1.0
},
"Category": {
"value": "Other",
"confidence": 1.0
},
"PaymentMethod": {
"value": "DEBIT_CARD",
"confidence": 1.0
},
"Currency": {
"value": "EUR",
"confidence": 1.0
},
"Website": {
"value": "dm.de",
"page": 1,
"confidence": 0.99
},
"Time": {
"value": "16:29",
"page": 1,
"confidence": 0.99
},
"Terminal": {
"value": "65237920",
"page": 1,
"confidence": 0.73
}
},
"productItems": [
{
"ProductName": {
"value": "Dr.Best Zahnbü.HT mittel 2+1",
"page": 1,
"confidence": 1.0
},
"ProductPrice": {
"value": "2.45",
"page": 1,
"confidence": 1.0
},
"ProductQuantity": {
"value": "1.0",
"page": 1,
"confidence": 1.0
},
"ProductUnitPrice": {
"value": "2.45",
"page": 1,
"confidence": 1.0
},
"TaxAmount": {
"value": "0.39",
"confidence": 1.0
},
"TaxNetAmount": {
"value": "2.06",
"confidence": 1.0
},
"TaxGrossAmount": {
"value": "2.45",
"page": 1,
"confidence": 1.0
},
"TaxPercentage": {
"value": "19.0",
"page": 1,
"confidence": 0.69
},
"TaxLabel": {
"value": "1",
"page": 1,
"confidence": 0.98
},
"Currency": {
"value": "EUR",
"confidence": 1.0
}
},
{
"ProductName": {
"value": "Zahnbürste Bambus 1St",
"page": 1,
"confidence": 1.0
},
"ProductPrice": {
"value": "7.4",
"page": 1,
"confidence": 1.0
},
"ProductQuantity": {
"value": "4.0",
"page": 1,
"confidence": 1.0
},
"ProductUnitPrice": {
"value": "1.85",
"page": 1,
"confidence": 1.0
},
"TaxAmount": {
"value": "1.18",
"confidence": 1.0
},
"TaxNetAmount": {
"value": "6.22",
"confidence": 1.0
},
"TaxGrossAmount": {
"value": "7.4",
"page": 1,
"confidence": 1.0
},
"TaxPercentage": {
"value": "19.0",
"page": 1,
"confidence": 0.69
},
"TaxLabel": {
"value": "1",
"page": 1,
"confidence": 1.0
},
"Currency": {
"value": "EUR",
"confidence": 1.0
}
},
...
],
"taxes": [
{
"TaxAmount": {
"value": "0.76",
"page": 1,
"confidence": 1.0
},
"TaxGrossAmount": {
"value": "11.65",
"page": 1,
"confidence": 1.0
},
"TaxPercentage": {
"value": "7.0",
"confidence": 1.0
},
"TaxLabel": {
"value": "2",
"page": 1,
"confidence": 0.48
},
"TaxNetAmount": {
"value": "10.89",
"page": 1,
"confidence": 1.0
}
},
{
"TaxAmount": {
"value": "3.68",
"page": 1,
"confidence": 1.0
},
"TaxGrossAmount": {
"value": "23.05",
"page": 1,
"confidence": 1.0
},
"TaxPercentage": {
"value": "19.0",
"page": 1,
"confidence": 1.0
},
"TaxLabel": {
"value": "1",
"page": 1,
"confidence": 0.47
},
"TaxNetAmount": {
"value": "19.37",
"page": 1,
"confidence": 1.0
}
}
],
"payments": [
{
"PaymentMethod": {
"value": "DEBIT_CARD",
"page": 1,
"confidence": 0.99
}
}
],
"performanceOption": "ACCURACY",
"fileHash": "96db620e2757d8832a7a7fd0035cd297",
"version": "2.08.26",
"numberOfPages": 1,
"pages": [
{
"width": 394.12992799666125,
"height": 1196.2985382403037
}
],
"fullText": null,
"languages": [
"de",
"en"
],
"mainLanguage": "de",
"verification": {
"NonDuplication": {
"flagValid": false,
"message": "Found 5 previous requests with the same file hash. The last 10 times requested: 2026-03-10T20:10:38.443Z; 2026-03-06T20:32:16.693Z; 2026-03-06T20:27:04.367Z; 2026-02-28T13:04:00.212Z; 2026-01-29T20:01:15.689Z; "
},
"TaxPercentage": {
"flagValid": true,
"message": "Tax percentage verification passed. No tax percentage found in general fields. [Country: DE, Tax Percentages: [19.0, 7.0, 0.0]] "
},
"ProductsSumVsTotalPrice": {
"flagValid": true,
"message": "Valid total price: TaxGrossAmount matches sum of product prices."
}
}
}
Developers integrate receipt scanner APIs into a wide range of applications:
Not all receipt APIs are created equal. Here's what sets Eagle Doc apart:
Eagle Doc's Receipt Scanner API gives you production-ready receipt extraction with a single API call. No training data, no templates, no complex setup. Sign up for a free API key, get 20 free pages, and start extracting receipt data in minutes.
Copyright © S2Tec GmbH