{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & DOCX to Markdown — Table Extraction & RAG Chunks",
    "description": "Convert PDF and Word (DOCX) files to LLM-ready Markdown. Tables stay real Markdown tables (76% of rows exact on unseen statistical PDFs vs 31% without our repair), plus headings, page markers and optional RAG chunks with page range and section path. Batch URLs or uploads. No AI keys.",
    "version": "0.1",
    "x-build-id": "ii8Jq2MdsB1za6vqd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ingenious_quip_bxq~pdf-docx-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ingenious_quip_bxq-pdf-docx-to-markdown",
        "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/ingenious_quip_bxq~pdf-docx-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ingenious_quip_bxq-pdf-docx-to-markdown",
        "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/ingenious_quip_bxq~pdf-docx-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ingenious_quip_bxq-pdf-docx-to-markdown",
        "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": "Document URLs (PDF or DOCX)",
            "type": "array",
            "description": "Direct links to PDF or DOCX files. Add as many as you like — they are processed as one batch. Tip: use the direct download link, not a viewer page.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload PDF or DOCX files from your computer (stored in your Apify key-value store). You can also paste URLs or key-value store references here (`recordKey` or `storeName/recordKey`)."
          },
          "outputFormat": {
            "title": "Output",
            "enum": [
              "markdown",
              "chunks",
              "markdown_and_chunks"
            ],
            "type": "string",
            "description": "`markdown`: one dataset item per document with the full Markdown. `chunks`: RAG-ready chunks (one dataset item per chunk) plus a document summary item. `markdown_and_chunks`: both.",
            "default": "markdown"
          },
          "pageMarkers": {
            "title": "Page markers",
            "enum": [
              "comment",
              "text",
              "none"
            ],
            "type": "string",
            "description": "How page boundaries appear in the Markdown. `comment` inserts `<!-- page: 3 -->` (invisible when rendered, easy to parse); `text` inserts `--- Page 3 ---`; `none` omits them. DOCX files only get markers where Word stored page breaks.",
            "default": "comment"
          },
          "saveMarkdownFiles": {
            "title": "Also save .md files",
            "type": "boolean",
            "description": "Save each document as a .md file in the run's key-value store (handy for downloading, and for very large documents that exceed dataset item limits).",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 100,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum chunk size (in the unit below). Chunks break at headings, paragraphs and table rows — never mid-row.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How much trailing context from the previous chunk is repeated at the start of the next one (same unit as chunk size, max 50% of chunk size).",
            "default": 150
          },
          "chunkUnit": {
            "title": "Chunk size unit",
            "enum": [
              "tokens",
              "characters"
            ],
            "type": "string",
            "description": "`tokens` uses a fast approximation (≈4 characters per token) so no tokenizer download is needed; `characters` is exact.",
            "default": "tokens"
          },
          "prependHeadingPath": {
            "title": "Prefix chunks with their section path",
            "type": "boolean",
            "description": "Adds a line like `Section: 4. Experiments > 4.1 ImageNet` to each chunk's text. The heading path is always available in the `headingPath` field either way.",
            "default": false
          },
          "pageRange": {
            "title": "Page range (PDF)",
            "pattern": "^\\s*(\\d+\\s*(-\\s*\\d*)?)?\\s*$",
            "type": "string",
            "description": "Convert only some pages, e.g. `1-10`, `5`, or `20-` (to the end). Leave empty for all pages."
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on pages converted (and billed) per PDF. 0 = no cap.",
            "default": 500
          },
          "repairTables": {
            "title": "Repair tables",
            "type": "boolean",
            "description": "Fix table artifacts (words split across columns, wrapped row labels, table captions glued into the header, empty columns). Uses the page's own words as ground truth, so it never invents text.",
            "default": true
          },
          "removeHeadersFooters": {
            "title": "Remove running headers and footers",
            "type": "boolean",
            "description": "Drop repeated page headers/footers (page numbers, running titles) so they don't pollute your chunks. Page numbers are still kept as page markers.",
            "default": true
          },
          "includeImageText": {
            "title": "Keep text found inside charts/figures",
            "type": "boolean",
            "description": "Charts often contain axis labels and tick numbers that read as noise. Off by default.",
            "default": false
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs (applied to all PDFs in the run)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}