{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown: DOCX, PPTX, XLSX, OCR & RAG Chunks",
    "description": "Convert PDF, DOCX, PPTX, XLSX, and HTML to clean Markdown that preserves tables and headings. Optional Tesseract OCR for scanned pages and heading-aware RAG chunks with source, page, and section metadata.",
    "version": "1.1",
    "x-build-id": "bRgAub28VAFAAqgch"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sunburst077~document-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sunburst077-document-to-markdown-rag",
        "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/sunburst077~document-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-sunburst077-document-to-markdown-rag",
        "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/sunburst077~document-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-sunburst077-document-to-markdown-rag",
        "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": {
          "startUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "HTTP(S) links to PDF, DOCX, PPTX, XLSX, or HTML documents. HTML pages are cleaned with a readability pass before Markdown conversion. One bad URL does not fail the run.",
            "default": [
              {
                "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
              }
            ],
            "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, Word, PowerPoint, Excel, or HTML files. The Console stores each file in a key-value store and passes the record URL to the Actor."
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "Read documents already stored in an Apify key-value store. Combine with keys below, or leave keys empty to convert every supported record."
          },
          "keyValueStoreKeys": {
            "title": "Key-value store keys",
            "type": "array",
            "description": "Specific record keys to convert (for example report.pdf). Leave empty to convert every PDF/DOCX/PPTX/XLSX/HTML record in the store.",
            "items": {
              "type": "string"
            }
          },
          "quality": {
            "title": "Conversion quality",
            "enum": [
              "auto",
              "fast",
              "accurate"
            ],
            "type": "string",
            "description": "Auto (recommended) and Fast use MarkItDown for office/HTML and PyMuPDF for born-digital PDFs. Accurate uses Docling layout + table reconstruction when Docling is installed in the image; this Store build does not include Docling, so Accurate falls back to Fast and still returns Markdown.",
            "default": "auto"
          },
          "saveMarkdownToKvs": {
            "title": "Save Markdown files to the key-value store",
            "type": "boolean",
            "description": "Write each successful conversion as a .md record (document-<name>-<n>.md) in the default key-value store, in addition to the dataset row.",
            "default": true
          },
          "enableOcr": {
            "title": "Enable OCR for scanned pages",
            "type": "boolean",
            "description": "Run Tesseract on PDF pages (or images) that have no usable text layer. Leave off for born-digital PDFs — it is the slowest and most expensive option. Uses the system Tesseract binary, not a cloud OCR API.",
            "default": false
          },
          "ocrLanguage": {
            "title": "OCR language",
            "type": "string",
            "description": "Tesseract language. This build ships English only (eng). Other codes are not available.",
            "default": "eng"
          },
          "enableChunking": {
            "title": "Create RAG chunks",
            "type": "boolean",
            "description": "Split the Markdown into overlapping chunks for embeddings / vector stores. Each chunk keeps source, page, and section (heading path) metadata.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 100,
            "maximum": 20000,
            "type": "integer",
            "description": "Target characters per chunk. 800–1500 works well for most embedding models. Tables larger than this stay in one chunk so rows are not split.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters copied from the end of the previous chunk onto the next one so sentences are not cut off at the boundary.",
            "default": 150
          },
          "headingAware": {
            "title": "Heading-aware chunks",
            "type": "boolean",
            "description": "Start a new chunk when the heading path changes (for example ## Revenue → ### Q3) and attach the heading path as section metadata.",
            "default": true
          },
          "pushChunksAsItems": {
            "title": "Also push each chunk as its own dataset row",
            "type": "boolean",
            "description": "Useful for Zapier / Make / RAG loaders that expect one dataset item per chunk. The parent document row is still written.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Skip (do not fail the run) any file larger than this. Keeps memory and download time predictable.",
            "default": 50
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Only the first N PDF pages (or PPTX slides / XLSX sheets) are converted. Extra pages are billed after the first 10 on successful documents.",
            "default": 100
          },
          "timeoutSeconds": {
            "title": "Per-document timeout",
            "minimum": 15,
            "maximum": 1800,
            "type": "integer",
            "description": "Give up on a single document after this many seconds and move on.",
            "default": 300
          },
          "maxDocuments": {
            "title": "Max documents per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on how many sources this run will process, in input order.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}