{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Text Extractor: DOCX, PPTX, Excel + OCR",
    "description": "Convert PDF, Word, PowerPoint, Excel, CSV, HTML and image files to clean Markdown or text for LLMs and RAG: headings, tables, reading order, page markers and chunks. Scanned pages are OCR'd locally with Tesseract. Pay per page; blank and failed pages are free.",
    "version": "1.0",
    "x-build-id": "oP8kpSZ06acyDLaix"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pewterdesk~documents-to-ai-ready-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pewterdesk-documents-to-ai-ready-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/pewterdesk~documents-to-ai-ready-markdown/runs": {
      "post": {
        "operationId": "runs-sync-pewterdesk-documents-to-ai-ready-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/pewterdesk~documents-to-ai-ready-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-pewterdesk-documents-to-ai-ready-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": {
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload your documents (PDF, DOCX, PPTX, XLSX, CSV, HTML, TXT/MD, PNG/JPG/TIFF/WEBP). Only process files you own or have the right to use."
          },
          "fileUrls": {
            "title": "File URLs",
            "type": "array",
            "description": "Direct links to your files. Google Drive / Docs, Dropbox and GitHub share links are converted to download links automatically (the file must be shared as 'anyone with the link').",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text",
              "both"
            ],
            "type": "string",
            "description": "Markdown keeps structure that LLMs use well; plain text strips formatting.",
            "default": "markdown"
          },
          "chunkSize": {
            "title": "Chunk size (characters, 0 = no chunking)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Split each document into RAG-ready chunks on paragraph/table boundaries, with page ranges. ~4 characters ≈ 1 token, so 2000 ≈ 500 tokens.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Trailing paragraphs repeated at the start of the next chunk (at most half the chunk size).",
            "default": 200
          },
          "outputMode": {
            "title": "Dataset rows",
            "enum": [
              "document",
              "chunks"
            ],
            "type": "string",
            "description": "'One row per chunk' needs a chunk size above 0. Billing is the same either way.",
            "default": "document"
          },
          "includePages": {
            "title": "Include per-page output",
            "type": "boolean",
            "description": "Adds a 'pages' array with Markdown, method (text/ocr) and OCR confidence for every page/slide/sheet.",
            "default": false
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Auto uses the PDF's text layer when it's good and falls back to local Tesseract OCR for scanned, image-only or broken-encoding pages. Images are always OCR'd.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages in your scanned documents. Picking only the ones you need is faster and more accurate.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "extractTables": {
            "title": "Detect tables",
            "type": "boolean",
            "description": "Render ruled PDF tables as Markdown tables in reading position.",
            "default": true
          },
          "pageRange": {
            "title": "Page range (PDF)",
            "type": "string",
            "description": "Optional, e.g. '1-5, 8, 20-'. Pages outside the range are skipped and not billed."
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap per file (0 = unlimited).",
            "default": 500
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Only if your PDFs are password-protected."
          },
          "includeSpeakerNotes": {
            "title": "Include PowerPoint speaker notes",
            "type": "boolean",
            "description": "Appends slide speaker notes as a quote under each slide.",
            "default": true
          },
          "htmlMainContentOnly": {
            "title": "HTML: main content only",
            "type": "boolean",
            "description": "Drops navigation, footers, sidebars, scripts and forms from HTML files.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped (not charged).",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Files processed in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Raise together with memory (each 1 GB ≈ one parallel OCR job).",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}