{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor & Document to Markdown (Word, Excel, PPT)",
    "description": "Extract text from PDF, Word, PowerPoint, Excel, HTML and EPUB files as clean Markdown for AI. PDF to Markdown, DOCX to text, OCR for scanned PDFs and images in 32 languages, plus free chunking for RAG and vector databases. Never charges for a failed or empty result.",
    "version": "1.1",
    "x-build-id": "8ajWwRjgIkrggdFWx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pavel.tashev~doc-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pavel.tashev-doc-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/pavel.tashev~doc-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-pavel.tashev-doc-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/pavel.tashev~doc-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-pavel.tashev-doc-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": "File URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Direct links to the documents you want to convert. Supports PDF (including scanned PDFs), Word (.docx), PowerPoint (.pptx), Excel (.xlsx), HTML, EPUB, CSV, JSON, XML, plain text and images (PNG, JPG, TIFF, WebP, BMP). You can paste many URLs or upload a text file with one URL per line.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "includeMarkdown": {
            "title": "Include Markdown in output",
            "type": "boolean",
            "description": "Turn off to return only metadata (file type, title, word count) without the converted text.",
            "default": true
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "off",
              "force"
            ],
            "type": "string",
            "description": "OCR reads text from images and from PDF pages that have no text layer (scans). \"Auto\" runs OCR only where it is needed, \"Off\" never runs it (scanned pages come back empty and images fail), \"Force\" OCRs every PDF page even if it already has text. OCR pages are charged separately.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the text in your scans and images. Pick the ones that appear in the documents (up to 5 of 32); each extra language makes OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "bul",
                "ron",
                "ces",
                "slk",
                "hun",
                "ell",
                "dan",
                "swe",
                "fin",
                "nor",
                "cat",
                "rus",
                "ukr",
                "tur",
                "ara",
                "heb",
                "hin",
                "jpn",
                "kor",
                "chi_sim",
                "chi_tra",
                "vie",
                "tha",
                "ind"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Bulgarian",
                "Romanian",
                "Czech",
                "Slovak",
                "Hungarian",
                "Greek",
                "Danish",
                "Swedish",
                "Finnish",
                "Norwegian",
                "Catalan",
                "Russian",
                "Ukrainian",
                "Turkish",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Japanese",
                "Korean",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Vietnamese",
                "Thai",
                "Indonesian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "maxOcrPagesPerFile": {
            "title": "Maximum OCR pages per file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Stop OCR after this many pages in one file. Up to 500 pages per file. If the first pages of a scan come back unreadable, the rest are skipped and nothing is charged for that file.",
            "default": 200
          },
          "chunkMode": {
            "title": "Split into chunks for RAG",
            "enum": [
              "off",
              "markdown",
              "fixed"
            ],
            "type": "string",
            "description": "Split the converted Markdown into retrieval-sized pieces for embeddings and RAG. \"By headings\" starts a new chunk at every heading and records the heading path; \"Fixed size\" only follows the size limit. Chunking is free: you pay per converted document, never per chunk.",
            "default": "off"
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Target size of one chunk in characters (roughly 4 characters per token, so 1,200 is about 300 tokens). Code blocks and tables are never cut in the middle.",
            "default": 1200
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How much text each chunk repeats from the previous one, so a sentence split across chunks is still found. Set 0 for no overlap.",
            "default": 150
          },
          "minChunkSize": {
            "title": "Minimum chunk size (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Chunks shorter than this are merged with their neighbour, so short sections don't become their own chunk.",
            "default": 200
          },
          "chunkOutput": {
            "title": "Where to put the chunks",
            "enum": [
              "field",
              "items"
            ],
            "type": "string",
            "description": "\"In the document\" adds a \"chunks\" array to each document. \"One item per chunk\" saves every chunk as its own dataset item, which is easier to import into a vector database.",
            "default": "field"
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files larger than this are skipped and not charged.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Files processed in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many documents to download and convert at the same time. Up to 8; higher values only risk running out of memory on large files.",
            "default": 5
          },
          "files": {
            "title": "Or paste files",
            "type": "array",
            "description": "Files pasted as base64 instead of URLs, for documents that are not on the public web. Each entry is {\"name\": \"report.pdf\", \"data\": \"<base64>\"} — a data: URI is accepted too.",
            "default": []
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for protected PDFs. Without it a protected file is reported as such and not charged. Note: this is stored with the run input rather than encrypted, because this Actor runs with limited permissions (which is what lets AI agents pay for it directly). Use a document password you are comfortable storing, not a password you reuse elsewhere."
          },
          "startPage": {
            "title": "Start page",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "First page to read, counting from 1. Leave empty to start at the beginning."
          },
          "endPage": {
            "title": "End page",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Last page to read, included. Leave empty to read to the end."
          },
          "firstNPages": {
            "title": "First N pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Read only the first N pages. Cheaper than reading the whole document."
          },
          "lastNPages": {
            "title": "Last N pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Read only the last N pages. Cannot be combined with \"First N pages\"."
          },
          "maxPagesPerFile": {
            "title": "Maximum pages per file",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "A ceiling applied after the other page settings, so one huge file cannot run away with the budget."
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Also return each page separately with its real page number, so an answer can cite the page.",
            "default": false
          },
          "skipEmptyPages": {
            "title": "Skip empty pages",
            "type": "boolean",
            "description": "Leave pages with no text out of the per-page output. Page numbers of the rest are unchanged.",
            "default": false
          },
          "removeHeadersFooters": {
            "title": "Remove running headers and footers",
            "type": "boolean",
            "description": "Strip lines that repeat near the top or bottom of most pages. Without this they appear in every chunk and pollute a retrieval index.",
            "default": false
          },
          "removePageNumbers": {
            "title": "Remove page numbers",
            "type": "boolean",
            "description": "Strip lines that are only a page number, such as \"12\" or \"Page 3 of 40\".",
            "default": false
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Also return tables as rows and as Markdown. Reliable on ruled tables (invoices, forms, financial statements). Borderless tables, common in academic papers, often yield nothing usable — those are dropped rather than returned as noise.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}