{
  "openapi": "3.0.1",
  "info": {
    "title": "Document to Markdown for AI & RAG",
    "description": "Convert PDF, Word, PowerPoint, Excel, CSV, HTML and TXT files into clean Markdown or plain text for LLMs and RAG. Keeps headings, lists and tables, splits into token-sized chunks with page and heading metadata, and OCRs scanned PDFs.",
    "version": "1.0",
    "x-build-id": "XP4CnTuywfXqFNtZL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/egra_van~document-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-egra_van-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/egra_van~document-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-egra_van-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/egra_van~document-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-egra_van-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": {
          "urls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Links to PDF, DOCX, PPTX, XLSX, CSV, TSV, HTML, TXT or Markdown files. Google Drive, Google Docs/Sheets/Slides, Dropbox, OneDrive/SharePoint, Box and GitHub share links are converted to direct downloads automatically (files must be shared as 'Anyone with the link').",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStoreKeys": {
            "title": "…or files in a key-value store",
            "type": "array",
            "description": "Keys of files uploaded to an Apify key-value store. Use 'storeIdOrName/key', or just 'key' together with the store below (default: this run's store).",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store ID or name",
            "type": "string",
            "description": "Store that holds the keys above."
          },
          "datasetId": {
            "title": "…or dataset with URLs",
            "type": "string",
            "description": "Apify dataset (e.g. output of a crawler) whose items contain document URLs."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Field of the dataset items that holds the URL.",
            "default": "url"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Output format.",
            "default": "markdown"
          },
          "chunking": {
            "title": "Chunking",
            "enum": [
              "none",
              "heading",
              "fixed"
            ],
            "type": "string",
            "description": "How to split documents into dataset items for embeddings / vector databases.",
            "default": "none"
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 50,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum chunk size, in the unit below. Typical for embeddings: 300–1000 tokens.",
            "default": 800
          },
          "chunkSizeUnit": {
            "title": "Chunk size unit",
            "enum": [
              "tokens",
              "characters"
            ],
            "type": "string",
            "description": "Chunk size unit.",
            "default": "tokens"
          },
          "chunkOverlap": {
            "title": "Chunk overlap",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "How much text from the end of a chunk is repeated at the start of the next one (same unit). Max half of the chunk size.",
            "default": 100
          },
          "includePageNumbers": {
            "title": "Insert page markers",
            "type": "boolean",
            "description": "Adds <!-- page: N --> (Markdown) or [Page N] (text) at every page/slide boundary. Page ranges are always in each item's metadata.",
            "default": false
          },
          "includeSpeakerNotes": {
            "title": "Include PowerPoint speaker notes",
            "type": "boolean",
            "description": "Include PowerPoint speaker notes.",
            "default": true
          },
          "ocr": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Read image-only (scanned) PDF pages and image files (PNG, JPG, TIFF, WebP) with OCR. Only pages without a text layer are OCR'd, and only those are charged as OCR pages.",
            "default": false
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages present in the scanned documents. Fewer languages = faster and more accurate.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "ron",
                "rus"
              ],
              "enumTitles": [
                "English",
                "Romanian",
                "Russian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Process only the first N pages/slides of each document (0 = all). For formats without pages the text is cut at N × 3,000 characters.",
            "default": 0
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Max documents.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Max file size (MB).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}