{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Document Converter: DOCX, PPTX, XLSX, OCR",
    "description": "Convert PDF to Markdown, plus Word (DOCX), PowerPoint (PPTX), Excel (XLSX), HTML and EPUB. Paste a URL, a Google Drive, Dropbox or SharePoint file or folder link, or upload files. Clean Markdown for LLMs and RAG, with OCR for scanned PDFs, tables and chunks. Pay per document.",
    "version": "1.3",
    "x-build-id": "MHoroTpNMSTqHUo1y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/flyingkiwi~document-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-flyingkiwi-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/flyingkiwi~document-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-flyingkiwi-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/flyingkiwi~document-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-flyingkiwi-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": {
          "url": {
            "title": "Document URL",
            "type": "string",
            "description": "One document or folder to convert: a public link, a Google Drive / Google Docs / Dropbox / OneDrive / SharePoint file share link, or a shared FOLDER link (Google Drive, Dropbox, SharePoint / OneDrive for Business, shared as \"anyone with the link\") to convert every supported file in it. The simplest input for AI agents. Use \"Document URLs\" or \"Upload files\" for more."
          },
          "urls": {
            "title": "Document URLs",
            "type": "array",
            "description": "More documents or folders: public URLs, file share links (Google Drive, Google Docs/Sheets/Slides, Dropbox, OneDrive, SharePoint) or shared folder links (Google Drive, Dropbox, SharePoint / OneDrive for Business). Each supported file in a folder becomes its own result. Supported formats: PDF, DOCX, PPTX, XLSX, XLS, HTML, EPUB, CSV, IPYNB, TXT, MD, JSON, XML.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload documents from your computer. Apify saves each upload in one of your key-value stores (you choose or create the store in the upload dialog). Then pick that same store in the next field, \"Key-value store with your uploads\", so the Actor is allowed to read it. Links need no extra step: public URLs and Google Drive, Dropbox, OneDrive or SharePoint file or folder links work on their own. Via the API you can also pass Apify key-value store record URLs (signed URLs work on their own)."
          },
          "filesStore": {
            "title": "Key-value store with your uploads",
            "type": "string",
            "description": "Only needed if you use \"Upload files\": pick the key-value store your files were uploaded into. The Actor gets read-only access to that one store and converts just the files you uploaded. If \"Upload files\" is empty, it converts every document in the store you pick (up to 1,000). Nothing in the store is changed."
          },
          "maxFiles": {
            "title": "Maximum files per folder link",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "For shared folder links: convert at most this many supported files from each folder (subfolders included). Files past the limit are listed in the run summary. Each converted file is charged as one document, and the run also stops cleanly at your maximum cost per run.",
            "default": 500
          },
          "includeSubfolders": {
            "title": "Include subfolders",
            "type": "boolean",
            "description": "For shared folder links: also convert files in subfolders (all levels). Each result has a relativePath like \"Reports/2024/q1.pdf\".",
            "default": true
          },
          "maxFolderDownloadMb": {
            "title": "Maximum Dropbox folder download (MB)",
            "minimum": 10,
            "maximum": 4000,
            "type": "integer",
            "description": "Dropbox shares a folder as a single ZIP of everything in it (including videos and images), so the run downloads that ZIP and converts the supported files inside. Folders larger than this are refused with a clear message: link a smaller subfolder or raise the limit. Not used for Google Drive or SharePoint, which download only the supported files.",
            "default": 500
          },
          "requestHeaders": {
            "title": "Request headers (optional)",
            "type": "object",
            "description": "Extra HTTP headers for downloading your URLs, e.g. {\"Authorization\": \"Bearer ...\"} or a Cookie for a private intranet or API. Sent only to the host of each URL you give, never to redirect targets or other sites. Stored encrypted."
          },
          "ocr": {
            "title": "OCR scanned PDF pages (paid add-on)",
            "type": "boolean",
            "description": "Read PDF pages that have no text layer (scans, photos) with a vision AI model through Apify's AI proxy. Only pages without text are sent, and only when this is on. Charged per OCR'd page (see Pricing); the AI model usage itself is billed by Apify to your account at cost (about $0.001 per page with the default model).",
            "default": false
          },
          "ocrMaxPagesPerDocument": {
            "title": "Maximum OCR pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on how many scanned pages are OCR'd in one document. Extra scanned pages are left empty and listed in the quality report.",
            "default": 50
          },
          "ocrModel": {
            "title": "OCR model",
            "type": "string",
            "description": "OpenRouter model ID used for OCR via Apify's AI proxy. Must accept images. The default is fast, cheap and accurate.",
            "default": "google/gemini-2.5-flash"
          },
          "chunkSize": {
            "title": "Chunk size (characters, 0 = off)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "If above 0, also split each document into heading-aware chunks of up to this many characters, ready for embeddings. 0 turns chunking off.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many characters from the end of one chunk to repeat at the start of the next. Only used when chunking is on.",
            "default": 200
          },
          "includeMarkdown": {
            "title": "Include full Markdown in results",
            "type": "boolean",
            "description": "Put the full Markdown text in each result. Turn off if you only need chunks or the saved .md file.",
            "default": true
          },
          "saveMarkdownFiles": {
            "title": "Also save each document as a .md file",
            "type": "boolean",
            "description": "Save each converted document as a Markdown record in the run's key-value store and return its URL.",
            "default": true
          },
          "pdfTables": {
            "title": "Detect tables in PDFs",
            "type": "boolean",
            "description": "Render tables found in PDFs as Markdown tables (best for tables drawn with lines). Each table's text also stays in the page text, so tables add some duplicate words, and large PDFs convert slower. Turn off for plain text only. Word, PowerPoint, Excel and HTML tables are always kept.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files larger than this are skipped (not charged).",
            "default": 25
          },
          "maxPagesPerDocument": {
            "title": "Maximum pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Documents with more pages than this are skipped (not charged). Protects you from unexpectedly large bills. For non-paginated formats one page = 500 words.",
            "default": 300
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many documents to process at the same time.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum time to download one file. Conversion may take up to 3 times longer for large files.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}