{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Word to Markdown / Text Converter (PDF, DOCX, HTML, TXT)",
    "description": "Convert PDF, Word DOCX, HTML and TXT files from any URL into clean Markdown or plain text for LLMs, RAG and search. Gets title, author, dates, page and word counts, splits by page, and flags scanned PDFs.",
    "version": "1.1",
    "x-build-id": "jtBrSZHv9xrdCeORG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dailypalslab~pdf-docx-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dailypalslab-pdf-docx-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/dailypalslab~pdf-docx-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-dailypalslab-pdf-docx-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/dailypalslab~pdf-docx-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-dailypalslab-pdf-docx-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",
        "required": [
          "fileUrls"
        ],
        "properties": {
          "fileUrls": {
            "title": "File URLs",
            "type": "array",
            "description": "Direct links to PDF, Word (.docx), HTML, TXT/Markdown files, or images (PNG, JPEG, WEBP, TIFF, BMP) to OCR. Google Drive, Google Docs and Dropbox share links are converted automatically. Files uploaded to an Apify key-value store work too (use the record URL).",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Markdown keeps headings, lists, tables and links (best for LLMs and RAG). Plain text strips all formatting.",
            "default": "markdown"
          },
          "splitByPage": {
            "title": "One result per page (PDF)",
            "type": "boolean",
            "description": "Output one dataset row per PDF page instead of one per document. Handy for chunking and page citations.",
            "default": false
          },
          "includePageBreaks": {
            "title": "Mark page breaks (PDF)",
            "type": "boolean",
            "description": "Insert a page marker between PDF pages (\"---\" + <!-- page N --> in Markdown, \"--- Page N ---\" in text).",
            "default": false
          },
          "includePerPage": {
            "title": "Add per-page array (PDF)",
            "type": "boolean",
            "description": "Also add a perPage array (page number, word count, content) to each document row.",
            "default": false
          },
          "ocr": {
            "title": "OCR (scanned PDFs and images)",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "type": "string",
            "description": "Auto: OCR only PDF pages that have no usable text layer (scans, image-only pages) plus image files; normal PDFs are not OCR'd. Always: OCR every page, ignoring the text layer (for PDFs with broken or garbled text). Off: never OCR. Each OCR'd page is billed as an ocr-page event.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages in the documents, as Tesseract codes: eng, deu, fra, spa, ita, por, nld, pol, rus, ukr, tur, ara, heb, hin, jpn, kor, chi_sim, chi_tra and more (2-letter codes like de or fr work too). Up to 5; more languages are slower. English is built in, others download once per run.",
            "default": [
              "eng"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxOcrPages": {
            "title": "Max OCR pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "OCR at most this many pages per document (1-500); further pages that need OCR are skipped and reported in the hint. Caps the ocr-page cost.",
            "default": 30
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Stop after this many pages (1-500). For DOCX/HTML/TXT, one page = 3,000 characters.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip files larger than this (1-100).",
            "default": 25
          },
          "maxFiles": {
            "title": "Max files per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Process at most this many URLs (hard cap 1000).",
            "default": 100
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Give up on a single file after this many seconds (download + conversion).",
            "default": 60
          },
          "maxConcurrency": {
            "title": "Files in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "1-5. Use 1024 MB+ memory for 4-5 large PDFs at once.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}