{
  "openapi": "3.0.1",
  "info": {
    "title": "Evidence-First PDF Table Extractor",
    "description": "Extract PDF tables to CSV and JSON with page and bounding-box provenance, OCR fallback, and explicit quality flags.",
    "version": "0.0",
    "x-build-id": "pCVl1eGQvyE8yVMPL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/defenestrator~evidence-first-pdf-table-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-defenestrator-evidence-first-pdf-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/defenestrator~evidence-first-pdf-table-extractor/runs": {
      "post": {
        "operationId": "runs-sync-defenestrator-evidence-first-pdf-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/defenestrator~evidence-first-pdf-table-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-defenestrator-evidence-first-pdf-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",
        "required": [
          "pdfSources"
        ],
        "properties": {
          "pdfSources": {
            "title": "PDF files or URLs",
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "description": "Upload PDF files or provide public HTTP/HTTPS PDF URLs. Private, loopback, link-local, and cloud-metadata destinations are blocked.",
            "items": {
              "type": "string",
              "minLength": 8,
              "maxLength": 4096
            }
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Auto OCRs bitmap regions while retaining embedded PDF text. Always forces full-page OCR. Never disables OCR. OCR table extraction is beta and every OCR-derived table is flagged for review. Effective OCR is limited to three selected pages per document; split longer scans or set the page limit to 3 or less.",
            "default": "auto"
          },
          "tableMode": {
            "title": "Table quality mode",
            "enum": [
              "fast",
              "accurate"
            ],
            "type": "string",
            "description": "Fast is the cost-controlled default. Accurate can improve complex/grouped headers but takes materially longer.",
            "default": "fast"
          },
          "maxDocuments": {
            "title": "Maximum documents",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Hard run cap. Extra supplied documents are not processed.",
            "default": 10
          },
          "maxPagesPerDocument": {
            "title": "Maximum pages per document",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Processing stops at this page limit for each PDF. If OCR is effective, this value must be 3 or less; digital PDFs with OCR skipped can use the full range.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Maximum PDF size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Download and conversion safety limit per PDF.",
            "default": 25
          },
          "downloadTimeoutSeconds": {
            "title": "PDF download deadline",
            "minimum": 15,
            "maximum": 120,
            "type": "integer",
            "description": "Absolute DNS, connection, redirect, and body download deadline per PDF.",
            "default": 60
          },
          "documentTimeoutSeconds": {
            "title": "Per-document conversion deadline",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Hard wall-clock deadline for the isolated Docling process. PDF preflight is separately isolated and capped at the lesser of 30 seconds or this value.",
            "default": 180
          },
          "conversionMemoryLimitMb": {
            "title": "Supervised process-tree RSS ceiling (MB)",
            "minimum": 1024,
            "maximum": 6144,
            "type": "integer",
            "description": "PDF preflight and Docling process-tree RSS are sampled every 250 ms and the process group is killed on an observed breach. This is not a kernel/cgroup hard cap. The value must fit within allocated Actor memory while leaving a 768 MB parent-process reserve.",
            "default": 3072
          },
          "saveDocumentMarkdown": {
            "title": "Save document Markdown",
            "type": "boolean",
            "description": "Save a bounded full-document Markdown export in the default key-value store.",
            "default": true
          },
          "failRunOnDocumentError": {
            "title": "Fail run when any document fails",
            "type": "boolean",
            "description": "Normally each failed PDF produces an explicit error row and the remaining PDFs continue.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}