{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Tables to JSON with Cell Coordinates + RAG Chunks (OCR)",
    "description": "PDF to JSON: every table as rows of cells with page number and bounding box, RAG-ready text chunks with page references, plus page text and Markdown. PDF table extraction and PDF parser for AI agents and data pipelines, optional OCR for scanned PDFs, pay per page.",
    "version": "0.1",
    "x-build-id": "teTK0zv5Ta8PCps88"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/landoz~pdf-to-json-tables/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-landoz-pdf-to-json-tables",
        "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/landoz~pdf-to-json-tables/runs": {
      "post": {
        "operationId": "runs-sync-landoz-pdf-to-json-tables",
        "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/landoz~pdf-to-json-tables/run-sync": {
      "post": {
        "operationId": "run-sync-landoz-pdf-to-json-tables",
        "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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "uniqueItems": true,
            "type": "array",
            "description": "Public http(s) links to the PDF files to convert, one per line. Each must point at the PDF itself (not an HTML viewer page). Up to 100 URLs per run; files are fetched once, parsed and deleted when the run ends.",
            "default": [
              "https://www.federalreserve.gov/releases/h41/current/h41.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "pdfUrl": {
            "title": "Single PDF URL (optional shortcut)",
            "type": "string",
            "description": "Convenience field for agents that pass one URL: it is merged into pdfUrls."
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Which pages to process, 1-based, like \"1-5,8\" or \"3-\" (3 to the end). Empty means all pages up to maxPagesPerPdf. Each processed page is one page-processed event."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap on pages processed (and charged) per file. Default 50, maximum 1000. Pages beyond the cap are skipped; pageCount in the output still shows the real total.",
            "default": 50
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "pages",
              "documents"
            ],
            "type": "string",
            "description": "pages: one dataset item per page (best for RAG and for streaming long reports). documents: one item per PDF with all text joined by form feeds, every table and chunk carrying its page number, plus PDF metadata (title, author, creator, producer, creationDate). Both charge per processed page.",
            "default": "pages"
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Detect tables and return them as rows of cells with header, row and column counts, a bounding box [x0, top, x1, bottom] in PDF points and a GitHub Markdown rendering. Ruled tables are found by their lines; tables without lines are found by text alignment with quality filters.",
            "default": true
          },
          "extractText": {
            "title": "Extract text",
            "type": "boolean",
            "description": "Return the plain text of each page (reading order, line breaks kept) and build chunks from it. Turn off if you only need tables.",
            "default": true
          },
          "markdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Also return each page as Markdown: headings detected from font size (20 percent above the page's body text), paragraphs joined, tables rendered as Markdown tables in place.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target size of RAG chunks in characters. Chunks end at sentence boundaries when possible and each carries page, chunkIndex, charStart and charEnd (offsets into that page's text) plus a citation object, the same chunk schema as the transcribe-to-json-chunks Actor. 0 disables chunking. Default 1200 (about 300 tokens).",
            "default": 1200
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many characters consecutive chunks share, so sentences cut at a boundary appear whole in one of them. Capped at half the chunk size. Default 150.",
            "default": 150
          },
          "ocr": {
            "title": "OCR",
            "enum": [
              "off",
              "auto",
              "always"
            ],
            "type": "string",
            "description": "off: text layer only, fastest and cheapest (default). auto: OCR only pages whose text layer has fewer than 20 characters (scanned pages inside otherwise normal PDFs). always: OCR every page, for fully scanned documents. OCR renders the page at 200 dpi and runs Tesseract; each OCR page adds one ocr-page event and takes a few seconds.",
            "default": "off"
          },
          "ocrLanguage": {
            "title": "OCR language",
            "type": "string",
            "description": "Tesseract language code for OCR. Only \"eng\" (English) is installed in this build; other codes return an OCR warning on each page. Default eng.",
            "default": "eng"
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "PDFs larger than this are skipped with an error item instead of being downloaded. Default 50, maximum 200.",
            "default": 50
          },
          "includeWordBoxes": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add wordBoxes to every page: each word with x0, top, x1, bottom in PDF points (and OCR confidence for OCR pages). Useful for highlighting and layout work; makes items several times larger.",
            "default": false
          },
          "includeCellBoxes": {
            "title": "Include table cell boxes",
            "type": "boolean",
            "description": "Add cells to every table: one entry per cell with row, col, text and its own bbox. Tables already carry a table-level bbox; turn this on when you need per-cell coordinates (for example to link a value back to its spot on the page).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}