{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Text Extractor: Word, HTML, OCR for RAG",
    "description": "Convert PDF, Word, PowerPoint, Excel, web pages and images to clean, LLM-ready Markdown. Paste links or upload files, click Start. Headings, lists and tables kept, optional OCR for scans, RAG chunks. No start fee.",
    "version": "0.1",
    "x-build-id": "adydxLjX9SPaLYUXp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alpine-data~docs-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alpine-data-docs-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/alpine-data~docs-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-alpine-data-docs-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/alpine-data~docs-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-alpine-data-docs-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": "1. Links to your documents (PDF, Word, PowerPoint, Excel, web page or image)",
            "type": "array",
            "description": "One link per line (commas also work, https:// is optional). Direct file links, Google Drive / Dropbox / GitHub share links and normal web pages all work. Supported: PDF, DOCX, PPTX, XLSX, HTML, TXT/MD/CSV/JSON, PNG/JPG/TIFF/WebP (images need OCR). Leave empty and upload files below instead. If you leave links, files and dataset empty, a small paid example runs instead: 1 sample PDF (15 pages), measured charge $0.0095.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "…or upload files from your computer",
            "type": "array",
            "description": "Upload one or more files (PDF, DOCX, PPTX, XLSX, HTML, images). They are stored in your own Apify storage and converted like links."
          },
          "useOcr": {
            "title": "2. Read scanned pages and images (OCR)",
            "type": "boolean",
            "description": "Off = fast and cheap: text is read from the file itself. On = pages without a text layer (scans, photos, images) are read with OCR (Tesseract) and charged as OCR pages. Pages that already have text are never OCR'd twice.",
            "default": false
          },
          "ocrLanguages": {
            "title": "3. Language of the scanned text",
            "type": "array",
            "description": "Only used when OCR is on. Pick one or more languages (each extra language makes OCR a little slower).",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "tur",
                "swe",
                "dan",
                "nor",
                "fin",
                "ron",
                "hun",
                "hrv",
                "slv",
                "slk"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Turkish",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Romanian",
                "Hungarian",
                "Croatian",
                "Slovenian",
                "Slovak"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "outputFormat": {
            "title": "What do you want back?",
            "enum": [
              "document",
              "chunks",
              "pages"
            ],
            "type": "string",
            "description": "Document = one row per file with the full Markdown. RAG chunks = one row per chunk (with heading path), ready for a vector database. Pages = one row per page/slide.",
            "default": "document"
          },
          "chunkSizeTokens": {
            "title": "Chunk size (tokens)",
            "minimum": 100,
            "maximum": 8000,
            "type": "integer",
            "description": "Only for RAG chunks. Approximate tokens per chunk (1 token ≈ 4 characters). Chunks split at headings and paragraphs.",
            "default": 800
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Only for RAG chunks. How much text is repeated between neighbouring chunks.",
            "default": 80
          },
          "keepLinks": {
            "title": "Keep hyperlinks",
            "type": "boolean",
            "description": "Off = link text only (cleaner for AI). On = keep [text](url) links in the Markdown.",
            "default": false
          },
          "webPageMainContentOnly": {
            "title": "Web pages: main content only",
            "type": "boolean",
            "description": "On = drop menus, cookie banners, footers and sidebars from web pages. Off = convert the whole page.",
            "default": true
          },
          "includeSlideNotes": {
            "title": "PowerPoint: include speaker notes",
            "type": "boolean",
            "description": "Add each slide's speaker notes below the slide text.",
            "default": true
          },
          "saveMarkdownFiles": {
            "title": "Save .md files",
            "type": "boolean",
            "description": "Also save every document as a .md file (plus ALL_DOCUMENTS.md) in the run's key-value store, with a download link in each row.",
            "default": true
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop converting a document after this many pages (for Word, Excel and web pages: 3,000 characters = 1 page). You only pay for converted pages.",
            "default": 300
          },
          "maxDocuments": {
            "title": "Max documents per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Only the first N links/files are processed.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are skipped (not charged). Big scanned PDFs need more memory: see README.",
            "default": 50
          },
          "datasetId": {
            "title": "Read links from a dataset",
            "type": "string",
            "description": "Pick a dataset (e.g. from a crawler run). Every row's link field is converted, together with the links above."
          },
          "datasetUrlField": {
            "title": "Link field in that dataset",
            "type": "string",
            "description": "Name of the column holding the file link, e.g. url, fileUrl, pdfUrl.",
            "default": "url"
          },
          "ocrForceAllPages": {
            "title": "OCR every page (even pages with text)",
            "type": "boolean",
            "description": "Only for broken PDFs whose text layer is garbage. Every page is then charged as an OCR page.",
            "default": false
          },
          "detectTables": {
            "title": "Detect tables in PDFs",
            "type": "boolean",
            "description": "Turn tables into Markdown tables. Switch off if a PDF's layout gets mangled.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}