Getting Started

The Receipt Extractor API allows you to programmatically extract data from receipts. Our API is RESTful and returns JSON responses.

Base URL
https://api.receiptextractor.com/v1

Authentication

All API requests require authentication using an API key. Include your API key in the request header:

Authorization Header
Authorization: Bearer YOUR_API_KEY

Endpoints

POST /extract

Extract data from a receipt image.

Request Body (multipart/form-data)

Parameter Type Required Description
image file Yes Receipt image file (JPEG, PNG, PDF)
model_id string No OCR model to use (default: auto)

Example Request

cURL
curl -X POST https://api.receiptextractor.com/v1/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@receipt.jpg"

Example Response

JSON
{
  "success": true,
  "data": {
    "merchant": "Example Store",
    "date": "2024-01-15",
    "total": 42.50,
    "currency": "USD",
    "items": [
      {
        "name": "Product A",
        "quantity": 2,
        "price": 15.00
      },
      {
        "name": "Product B",
        "quantity": 1,
        "price": 12.50
      }
    ],
    "tax": 3.50,
    "subtotal": 39.00
  },
  "confidence": 0.95
}
GET /models

List available OCR models.

Example Response

JSON
{
  "models": [
    {
      "id": "tesseract",
      "name": "Tesseract OCR",
      "tier": "free"
    },
    {
      "id": "donut-sroie",
      "name": "Donut SROIE",
      "tier": "pro"
    },
    {
      "id": "florence2",
      "name": "Florence-2",
      "tier": "pro"
    }
  ]
}

Rate Limits

Plan Requests/minute Requests/month
Free 10 100
Pro 60 5,000
Business 120 20,000

Error Handling

The API returns standard HTTP status codes and JSON error responses:

Error Response
{
  "success": false,
  "error": {
    "code": "INVALID_IMAGE",
    "message": "The uploaded file is not a valid image"
  }
}