{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown – DOCX, PPTX, XLSX & HTML for LLM & RAG",
    "description": "Convert PDF to Markdown, plus Word (DOCX), PowerPoint (PPTX), Excel (XLSX/CSV) and HTML documents, into clean LLM-ready Markdown or plain text. Keeps headings, lists and tables, adds metadata and RAG chunking (per page or by tokens with overlap). Pay only per page.",
    "version": "1.0",
    "x-build-id": "Zwuc3EwyQrjgqKKCU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/openharvest~document-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-openharvest-document-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/openharvest~document-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-openharvest-document-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/openharvest~document-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-openharvest-document-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": {
          "fileUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Direct links to documents: PDF, DOCX, PPTX, XLSX/XLS/ODS, CSV, HTML web pages, TXT or MD. The type is detected from the file content, so URLs without an extension work too. Example: <code>https://arxiv.org/pdf/1706.03762</code>.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Uploaded files",
            "type": "array",
            "description": "Optional. Upload documents from your computer (they are stored in an Apify key-value store) - or enter keys of records in this run's default key-value store."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text",
              "both"
            ],
            "type": "string",
            "description": "<b>markdown</b> keeps headings, lists, tables and links (best for LLMs). <b>text</b> is plain text without Markdown syntax. <b>both</b> returns both fields.",
            "default": "markdown"
          },
          "chunking": {
            "title": "Chunking (for RAG)",
            "enum": [
              "none",
              "page",
              "tokens"
            ],
            "type": "string",
            "description": "<b>none</b>: one dataset item per document. <b>page</b>: one item per PDF page / slide / sheet (DOCX and HTML are split at H1/H2 headings). <b>tokens</b>: chunks of about <i>Chunk size</i> tokens with overlap, ready for embeddings. Chunking does not change the price.",
            "default": "none"
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 50,
            "maximum": 32000,
            "type": "integer",
            "description": "Target chunk size in tokens (estimated as 4 characters per token) when Chunking = tokens. Chunks break on paragraph boundaries where possible.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 16000,
            "type": "integer",
            "description": "How many tokens from the end of one chunk are repeated at the start of the next (Chunking = tokens). Max half of the chunk size.",
            "default": 100
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional. Convert only these pages (PDF), slides (PPTX) or sheets (XLSX), e.g. <code>1-5</code>, <code>1,3,7-9</code> or <code>10-</code>. Empty = all. Ignored for DOCX and HTML."
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Upper limit of pages / slides / sheets converted per document (DOCX and HTML: estimated pages). You pay per page, so this also caps your cost. 0 = no limit.",
            "default": 200
          },
          "includeTables": {
            "title": "Tables as Markdown tables",
            "type": "boolean",
            "description": "Render tables from DOCX, PPTX, XLSX and HTML as GitHub-flavoured Markdown tables. If off, table rows are output as tab-separated lines.",
            "default": true
          },
          "includeSpeakerNotes": {
            "title": "Include PowerPoint speaker notes",
            "type": "boolean",
            "description": "Append the speaker notes of each slide (PPTX) as a quote block.",
            "default": true
          },
          "extractMainContent": {
            "title": "HTML: main content only",
            "type": "boolean",
            "description": "For web pages, keep only the main article (Mozilla Readability) and drop navigation, menus, footers and ads. Turn off to convert the whole page.",
            "default": true
          },
          "maxRowsPerSheet": {
            "title": "Max rows per sheet",
            "minimum": 1,
            "type": "integer",
            "description": "Spreadsheets: convert at most this many non-empty rows per sheet (protects you from giant tables).",
            "default": 5000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip files larger than this (reported as a free error item).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}