{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Text with OCR - Word, PowerPoint, RAG Chunks",
    "description": "Convert PDF, scanned PDFs, Word (DOCX), PowerPoint (PPTX) and images of text to clean Markdown for AI and RAG. Keeps headings, lists and tables, adds page-numbered chunks with token counts. Direct, arXiv, Google Docs/Slides, Drive and Dropbox links. $0.003 per document; scanned pages $0.005 (OCR).",
    "version": "0.1",
    "x-build-id": "h6of5qdeoGInSne94"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tedock~doc-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tedock-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/tedock~doc-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-tedock-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/tedock~doc-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-tedock-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Document URLs",
            "type": "array",
            "description": "List of links to the files to convert, each as {\"url\": \"https://...\"} (plain strings also work). Accepts PDF (including scanned PDFs), DOCX, PPTX and images of text (PNG, JPEG, BMP, WebP); the type is detected from the file contents, so the link does not need an extension. Also accepted: arXiv abstract pages (arxiv.org/abs/...), public Google Docs and Google Slides links (exported to DOCX / PPTX), and Google Drive or Dropbox share links set to \"Anyone with the link\". Links must be public (no login). Private or local addresses are rejected. Duplicate links are converted once. Example: [{\"url\": \"https://arxiv.org/pdf/1706.03762\"}]. Empty or invalid lists make the run fail.",
            "default": [
              {
                "url": "https://arxiv.org/pdf/1706.03762"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "outputMode": {
            "title": "Output rows",
            "enum": [
              "documents",
              "chunks"
            ],
            "type": "string",
            "description": "Choose the shape of the dataset. 'documents' gives one row per file with the full Markdown plus its chunks (best for reading or storing documents). 'chunks' gives one row per chunk with text, tokens, section path and page numbers (best for loading into a vector database). Default: documents.",
            "default": "documents"
          },
          "chunkTokens": {
            "title": "Chunk size (tokens)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "Maximum size of each chunk, in estimated tokens (about 4 characters per token; not exact for any one model). Chunks follow headings, keep each table whole where it fits, and never mix two sections. Use 300-500 for search/RAG, 1000-2000 for long-context models. 0 skips chunking (ignored when outputMode is 'chunks', which uses 500). Default: 500.",
            "default": 500
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Tokens repeated from the end of one chunk at the start of the next, so context is not lost at the boundary. 0 means no overlap. Try 30-80 for search. Default: 0.",
            "default": 0
          },
          "includePageMarkers": {
            "title": "Keep page markers in Markdown",
            "type": "boolean",
            "description": "If true, the Markdown contains <!-- page: N --> comments between pages (PDF and PPTX). Chunks always carry pageStart and pageEnd for citations whether this is on or off. Default: false.",
            "default": false
          },
          "includeSpeakerNotes": {
            "title": "Include PPTX speaker notes",
            "type": "boolean",
            "description": "PPTX only. If true, each slide's speaker notes are added under the slide as a quote starting with 'Speaker notes:'. Default: true.",
            "default": true
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Only the first N pages (PDF pages, PPTX slides, or about 500 words per DOCX page) of each file are converted. Skipped pages are not charged. Default: 300.",
            "default": 300
          },
          "ocrScannedPages": {
            "title": "Read scanned pages (OCR)",
            "type": "boolean",
            "description": "Reads scanned PDF pages (images of text with no text layer) and image files (PNG, JPEG, BMP, WebP) with OCR. Each scanned page that has readable text costs $0.005 on top of the document price; blank or unreadable pages are free. On by default so scanned files work out of the box. Turn off to skip scanned pages for free.",
            "default": true
          },
          "maxOcrPagesPerFile": {
            "title": "Max scanned pages per file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Reads at most this many scanned pages in each file, so one long scanned book can't use up your budget. Pages over the limit are skipped and not charged. Default: 50.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Files larger than this are rejected before conversion and are not charged. Default: 50.",
            "default": 50
          },
          "concurrency": {
            "title": "Files at once",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many files are downloaded and converted at the same time. Raise for many small files; lower for very large PDFs. Default: 3.",
            "default": 3
          },
          "expectedText": {
            "title": "Expected text (self-test)",
            "type": "string",
            "description": "Optional check. If set, the run fails unless at least one converted file's Markdown contains this text. Used for scheduled self-tests; leave empty for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}