{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Excel: Invoice & Table Extractor",
    "description": "PDF to Excel, CSV or JSON rows. Invoices: supplier, number, dates, VAT, totals and one row per line item, with totals cross-checked. Any other PDF: every table becomes rows. No AI, no API key. $6 per 1,000 pages with data ($4.50 on Business); empty pages and failed files free.",
    "version": "1.0",
    "x-build-id": "UXVAXL5wzcsJbD5B4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/egra_van~pdf-invoice-table-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-egra_van-pdf-invoice-table-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/egra_van~pdf-invoice-table-extractor/runs": {
      "post": {
        "operationId": "runs-sync-egra_van-pdf-invoice-table-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/egra_van~pdf-invoice-table-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-egra_van-pdf-invoice-table-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": {
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Links to PDF files: invoices, bills, purchase orders, price lists, statistical tables, reports. Google Drive, Dropbox, OneDrive/SharePoint, Box and GitHub share links are converted to direct downloads (share them as 'Anyone with the link').",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "kvStoreFileNames": {
            "title": "…or PDFs in a key-value store",
            "type": "array",
            "description": "Names of PDF files uploaded to an Apify key-value store. Use 'storeIdOrName/fileName', or just 'fileName' together with the store below (default: this run's store).",
            "items": {
              "type": "string"
            }
          },
          "kvStoreId": {
            "title": "Key-value store ID or name",
            "type": "string",
            "description": "Store that holds the files above."
          },
          "datasetId": {
            "title": "…or dataset with PDF URLs",
            "type": "string",
            "description": "Apify dataset (for example the output of a crawler) whose items contain PDF URLs."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Field of the dataset items that holds the PDF URL.",
            "default": "url"
          },
          "mode": {
            "title": "What to extract",
            "enum": [
              "auto",
              "invoice",
              "tables"
            ],
            "type": "string",
            "description": "Auto treats a PDF as an invoice when page 1 says invoice / bill to / factura / Rechnung / facture and an item table or invoice fields are found; otherwise every table becomes rows.",
            "default": "auto"
          },
          "tableDetection": {
            "title": "Table detection",
            "enum": [
              "auto",
              "lines",
              "text"
            ],
            "type": "string",
            "description": "Keep 'Auto' unless you get extra small tables you do not need.",
            "default": "auto"
          },
          "parseNumbers": {
            "title": "Convert numbers",
            "type": "boolean",
            "description": "Turn '1,234.50', '1.234,50', '$12.00' and '(15.00)' into numbers (decimal comma or point is detected per document), so they sum correctly in Excel. Percentages and codes with leading zeros stay as text.",
            "default": true
          },
          "dateOrder": {
            "title": "Date order for dates like 03/04/2026",
            "enum": [
              "auto",
              "DMY",
              "MDY"
            ],
            "type": "string",
            "description": "Invoice dates are returned as YYYY-MM-DD. Only matters when day and month are both 12 or less.",
            "default": "auto"
          },
          "saveExcel": {
            "title": "Save one Excel file for the run",
            "type": "boolean",
            "description": "Also saves OUTPUT.xlsx in the run's key-value store: a sheet with all invoice lines, a sheet with one row per invoice, and one sheet per table. The dataset itself can be exported to CSV, Excel or JSON as usual.",
            "default": true
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Only for password-protected PDFs (the same password is tried on every file)."
          },
          "maxPagesPerDocument": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Read only the first N pages of each PDF (0 = all pages).",
            "default": 0
          },
          "maxDocuments": {
            "title": "Max PDFs",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of PDFs in one run.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped (not charged).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}