{
  "openapi": "3.0.1",
  "info": {
    "title": "Invoice Data Extractor: PDF & Image to JSON (No LLM)",
    "description": "Extract vendor, invoice number, dates, line items, tax, total and currency from invoice PDFs and clean images as JSON. Rule-based with local OCR: no LLM, no API keys, documents never leave the run. Rejects non-invoices and unreadable photos free.",
    "version": "0.1",
    "x-build-id": "KV8kagDfR0gQJh2dC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steady_kahikatea~document-data-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steady_kahikatea-document-data-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/steady_kahikatea~document-data-extractor/runs": {
      "post": {
        "operationId": "runs-sync-steady_kahikatea-document-data-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/steady_kahikatea~document-data-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-steady_kahikatea-document-data-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "useSampleDocument": {
            "title": "Use the built-in sample invoice",
            "type": "boolean",
            "description": "Run on a bundled sample invoice (free, ignored when you give your own documents). Untick it when you add your own files, URLs or text.",
            "default": false
          },
          "fileUrls": {
            "title": "Upload files or paste document URLs",
            "type": "array",
            "description": "PDF, scanned PDF, PNG/JPG/TIFF image, DOCX, HTML, XLSX, CSV or text. Public HTTP(S) URLs only. Max 50 MB per file, 100 documents per run."
          },
          "documents": {
            "title": "Documents (advanced)",
            "type": "array",
            "description": "Array of objects for API/automation use: {\"url\":\"https://...\"}, {\"base64\":\"<file bytes>\",\"filename\":\"invoice.pdf\"} (handy for n8n/Make binary attachments), or {\"keyValueStoreId\":\"...\",\"key\":\"...\"}."
          },
          "text": {
            "title": "Or paste text / Markdown",
            "type": "string",
            "description": "Plain text or Markdown to extract from (for example the output of the Document to Markdown Actor, or an email body)."
          },
          "datasetId": {
            "title": "Or pick a dataset with Markdown/text",
            "type": "string",
            "description": "Pick a dataset whose items contain a text field (e.g. the output of the Document to Markdown Actor). Each item with text is extracted as one document. The Actor only gets access to the dataset you pick."
          },
          "datasetTextField": {
            "title": "Dataset text field",
            "type": "string",
            "description": "Field with the document text. Falls back to markdown, text, content, body.",
            "default": "markdown"
          },
          "documentType": {
            "title": "Document type",
            "enum": [
              "auto",
              "invoice",
              "receipt",
              "form",
              "table",
              "generic"
            ],
            "type": "string",
            "description": "auto detects invoice / receipt / form / table. Force a type if detection is wrong.",
            "default": "auto"
          },
          "fieldSchema": {
            "title": "Custom fields (optional)",
            "type": "array",
            "description": "Your own fields, found by label and/or regex. Each item: {\"name\":\"poNumber\",\"labels\":[\"PO No\",\"Purchase Order\"],\"type\":\"string\"} or {\"name\":\"ref\",\"regex\":\"REF-(\\\\d+)\"}. Types: string, number, integer, currency, date, boolean, email, phone, percent, list. Optional: multiple, required, default, regexGroup."
          },
          "outputMode": {
            "title": "Output shape",
            "enum": [
              "document",
              "flat",
              "lineItems",
              "tableRows"
            ],
            "type": "string",
            "description": "document: one nested record per document. flat: one flat row per document (Google Sheets / Airtable). lineItems: one row per invoice line. tableRows: one row per table row.",
            "default": "document"
          },
          "includeTables": {
            "title": "Include tables",
            "type": "boolean",
            "description": "Detect tables and return them as rows. Default: on for forms/tables/generic documents, off for invoices and receipts (their line items are returned separately)."
          },
          "includeKeyValues": {
            "title": "Include key-value pairs",
            "type": "boolean",
            "description": "For forms and generic documents: return every 'Label: value' pair found.",
            "default": true
          },
          "includeText": {
            "title": "Include extracted text",
            "type": "boolean",
            "description": "Add the plain text the extraction ran on (helps debugging layouts).",
            "default": false
          },
          "dateOrder": {
            "title": "Ambiguous date order",
            "enum": [
              "auto",
              "dmy",
              "mdy"
            ],
            "type": "string",
            "description": "How to read 03/04/2026. Auto uses document language hints.",
            "default": "auto"
          },
          "defaultCurrency": {
            "title": "Default currency",
            "type": "string",
            "description": "ISO code (USD, EUR, GBP...) used when the document shows no currency symbol or code."
          },
          "enableOcr": {
            "title": "OCR scanned pages and images",
            "type": "boolean",
            "description": "Run Tesseract OCR on images and PDF pages without a text layer. Billed per OCR'd page. Slower and less accurate than digital PDFs.",
            "default": true
          },
          "ocrLanguage": {
            "title": "OCR language",
            "type": "string",
            "description": "Tesseract language codes (eng, deu, fra, spa, por, ita, nld), combined with +, e.g. deu+eng. Or 'auto': read with English first, detect the language from the text and re-read with that pack (helps accented names; on our test photos it was on par with plain English, so the default stays eng).",
            "default": "eng"
          },
          "imageQualityCheck": {
            "title": "Image quality check",
            "enum": [
              "reject",
              "warn",
              "off"
            ],
            "type": "string",
            "description": "reject (default): photos and scans that cannot be read reliably (blurred, tiny text, very low contrast, OCR confidence far too low) fail with IMAGE_TOO_LOW_QUALITY and are not charged, instead of returning guesses. warn: process anyway and add a warning. off: no check.",
            "default": "reject"
          },
          "documentTypeCheck": {
            "title": "Not-an-invoice check",
            "enum": [
              "reject",
              "warn",
              "off"
            ],
            "type": "string",
            "description": "In automatic document type mode, documents with no invoice or receipt evidence (letters, contracts, menus, press releases, lists of invoices, plain text) return DOCUMENT_TYPE_NOT_RECOGNISED with no fields and no charge instead of invented values. 'warn' returns best-effort output with a warning; 'off' disables the check. The check never applies when you choose a documentType, give a fieldSchema, or process spreadsheets/CSV.",
            "default": "reject"
          },
          "strictOcrTotals": {
            "title": "Strict OCR totals",
            "type": "boolean",
            "description": "On photos and scans, a total that is printed once, is not a clearly labelled total and does not agree with the line items or subtotal + tax is returned as null (with a warning) instead of a probably misread number. Turn off to always get the best guess.",
            "default": true
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Pages beyond this are ignored.",
            "default": 50
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}