{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Table to Validated Rows (CSV, Excel, JSON)",
    "description": "Extract the table from supplier PDFs (price lists, order confirmations, stock reports) into flat, validated rows: header aliases, European and US numbers and dates, required fields, duplicates and line-total checks. Rejected rows come back with reasons; you pay only for accepted rows.",
    "version": "0.0",
    "x-build-id": "aK8ele50tco3K2tk2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/first_watch~pdf-table-extraction/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-first_watch-pdf-table-extraction",
        "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/first_watch~pdf-table-extraction/runs": {
      "post": {
        "operationId": "runs-sync-first_watch-pdf-table-extraction",
        "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/first_watch~pdf-table-extraction/run-sync": {
      "post": {
        "operationId": "run-sync-first_watch-pdf-table-extraction",
        "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",
        "required": [
          "documents",
          "targetSchema"
        ],
        "properties": {
          "documents": {
            "title": "Documents",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "Each document needs a unique 'id' (copied to every output row) and exactly one source: 'base64Document' (a PDF as standard base64, line breaks ignored), 'csv' or 'text' (delimited text; the delimiter is detected among comma, semicolon, tab and pipe unless you set 'delimiter', up to 4 characters, 'tab' allowed), 'json' (records, a header-first matrix, or an object with a records, rows or data array), 'html' (up to ten simple tables), 'records' (array of flat objects), or 'keyValueStoreId' plus 'keyValueStoreKey' (a binary PDF in one of your named key-value stores). Optional per-document 'numberFormat' (auto, en, eu) and 'dateFormat' (auto, YMD, DMY, MDY) override the run options for that document. PDFs accept an optional 'pageRange' object with 'from' and 'to'. 'url' is reserved: no public PDF host is approved, so URL documents fail with PUBLIC_SOURCE_NOT_APPROVED and no request is made. The prefill is a real one-page supplier price list PDF that runs offline.",
            "items": {
              "type": "object"
            }
          },
          "targetSchema": {
            "title": "Target schema",
            "type": "object",
            "description": "Your canonical output columns and checks. 'columns' (1 to 32 entries) each have a 'name', a 'type' (string, number, integer, boolean or date), an optional 'required' flag and optional 'aliases' (source header labels that map to this column; matching ignores case by default). Optional 'uniqueBy' lists fields that must be unique among the accepted rows of one document. Optional 'arithmeticChecks' describe relations such as quantity multiplied by unit_price equals line_total, with operator sum, subtract or multiply and an absolute 'tolerance' (default 0.01), computed with exact decimals. 'allowUnexpectedColumns' (default false) rejects rows of tables that contain undeclared columns. Set it to true to ignore extra columns."
          },
          "options": {
            "title": "Parsing options",
            "type": "object",
            "description": "'numberFormat': auto (default) reads 1,234.56 and 1.234,56. A value such as 1.234 that differs between US and European notation is settled by the other numbers of the same document (for example 0,84 settles European notation); if the document does not settle it, the row is rejected with AMBIGUOUS_NUMBER. en or eu fixes the notation. 'dateFormat': auto (default) settles dates such as 03/04/2026 when the same document contains an unambiguous date such as 25/04/2026. If the document has no date evidence but uses European number notation (decimal comma), day-month-year order is applied and reported as 'DMY-inferred-from-number-format'. Otherwise ambiguous dates are rejected with AMBIGUOUS_DATE. YMD, DMY or MDY fixes it. 'caseInsensitiveHeaders', 'trimValues' and 'emptyStringIsNull' default to true. 'failOnAnyRejectedRow' (default false) withholds every accepted row and fails the run when any row is rejected. 'ocrAllowed' must stay false because OCR is not performed.",
            "default": {
              "numberFormat": "auto",
              "dateFormat": "auto",
              "caseInsensitiveHeaders": true,
              "trimValues": true,
              "emptyStringIsNull": true,
              "failOnAnyRejectedRow": false,
              "ocrAllowed": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}