{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Table Extractor: Cross-Page Tables to CSV & JSON",
    "description": "Extract tables from PDFs and rejoin the ones a page break cut in half. Reads ruled and borderless tables, drops the header the file repeats on every page, names each column type, and returns one clean grid per table as JSON and CSV.",
    "version": "0.1",
    "x-build-id": "gqIHQMRXgyJgbnHbl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aiqlabs~pdf-table-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aiqlabs-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/aiqlabs~pdf-table-extractor/runs": {
      "post": {
        "operationId": "runs-sync-aiqlabs-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/aiqlabs~pdf-table-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-aiqlabs-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": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. A link that lands on a login page or an HTML page is reported rather than silently skipped.",
            "items": {
              "type": "string"
            }
          },
          "mergeAcrossPages": {
            "title": "Rejoin tables split across page breaks",
            "type": "boolean",
            "description": "A table that runs onto the next page arrives as two tables, each with its own copy of the header. Turn this on and the fragments become one grid with the repeated header rows removed. Fragments are only joined when their columns line up and either the document's own caption says the table continues, or the header is repeated verbatim.",
            "default": true
          },
          "useWhitespaceTables": {
            "title": "Also find borderless tables",
            "type": "boolean",
            "description": "Look for tables that draw no lines, by finding column gaps that stay empty on every row. Turn this off if you only want tables the file explicitly ruled.",
            "default": true
          },
          "onlyDataTables": {
            "title": "Only tables with numeric columns",
            "type": "boolean",
            "description": "A tax form is a grid of ruled boxes and will be found as a table. Turn this on to keep only tables where at least one column reads as numbers, currency, percentages or dates.",
            "default": false
          },
          "includeCsv": {
            "title": "Include a CSV field per table",
            "type": "boolean",
            "description": "Adds a ready-to-save CSV string of the whole table, header included, to each row.",
            "default": true
          },
          "includeRecords": {
            "title": "Include one object per row, keyed by header",
            "type": "boolean",
            "description": "Adds a `records` field: the body rows as objects whose keys are the detected column headers. Convenient, but it makes the output larger.",
            "default": false
          },
          "reportFilesWithoutTables": {
            "title": "Report files where nothing was found",
            "type": "boolean",
            "description": "Push a row for every PDF that yielded no table, with the reason. Turn off for a dataset of tables only.",
            "default": true
          },
          "minRows": {
            "title": "Minimum rows",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Grids with fewer rows than this are not reported. Borderless tables always need at least three.",
            "default": 2
          },
          "minColumns": {
            "title": "Minimum columns",
            "minimum": 2,
            "maximum": 50,
            "type": "integer",
            "description": "Grids narrower than this are not reported.",
            "default": 2
          },
          "maxPages": {
            "title": "Maximum pages per PDF",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Pages beyond this are not read. A table that continues past the limit is reported as ending there.",
            "default": 200
          },
          "maxRowsPerTable": {
            "title": "Maximum rows per table",
            "minimum": 10,
            "maximum": 100000,
            "type": "integer",
            "description": "Rows kept per table. A table longer than this is truncated and flagged.",
            "default": 5000
          },
          "maxCellChars": {
            "title": "Maximum characters per cell",
            "minimum": 50,
            "maximum": 100000,
            "type": "integer",
            "description": "Characters kept per cell. Longer cell text is cut here.",
            "default": 2000
          },
          "maxFileMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Downloading stops at this size and the file is reported as too large, so one huge PDF cannot take the run down.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "How long to wait for one PDF to download before giving up on it.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "PDFs at a time",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to read at the same time.",
            "default": 5
          },
          "maxPdfs": {
            "title": "Maximum PDFs per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard ceiling on how many URLs one run will read.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}