{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Document to Markdown: OCR, Tables, RAG Chunks",
    "description": "Convert PDFs, scanned images, Word, PowerPoint, Excel, CSV and HTML into clean Markdown or text with tables, OCR for scanned pages (12 languages preinstalled) and token-sized chunks for RAG and LLM pipelines.",
    "version": "1.2",
    "x-build-id": "knL6vUNAe2TByIPNW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vimplement~document-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vimplement-document-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/vimplement~document-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-vimplement-document-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/vimplement~document-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-vimplement-document-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": "Document URLs",
            "type": "array",
            "description": "Public links to the documents to convert: PDF (text or scanned), PNG/JPG/TIFF images, DOCX, PPTX, XLSX, CSV, TXT/Markdown and HTML pages. The file type is detected from the file itself, so links without an extension work too. Leave empty if you upload files below. The example is an 11-page public-domain NOAA hurricane report with headings and tables.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload documents from your computer instead of, or as well as, links. Apify keeps each upload in a key-value store you choose: temporary storage is deleted after your data retention period, permanent storage stays until you delete it. Same file types and price as links."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text",
              "both"
            ],
            "type": "string",
            "description": "Markdown keeps headings, lists and tables (best for LLMs and RAG). Text is plain text. Both returns both fields.",
            "default": "markdown"
          },
          "ocr": {
            "title": "OCR (scanned pages and images)",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "type": "string",
            "description": "Auto reads only pages without a text layer (scans) with OCR. Always runs OCR on every page. Off never runs OCR. OCR'd pages are charged per page.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Tesseract language codes, e.g. eng, nor, swe, dan, fin, deu, fra, spa, ita, por, nld, pol (preinstalled). Other Tesseract languages (e.g. jpn, chi_sim, ara) are downloaded automatically. Use several for mixed documents.",
            "default": [
              "eng"
            ],
            "items": {
              "type": "string"
            }
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional pages to extract, 1-based: e.g. '1-5,8,10-'. Empty = all pages (up to the maximum below)."
          },
          "maxPages": {
            "title": "Maximum pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Extraction stops after this many pages of each document.",
            "default": 200
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Detect tables in PDFs and return each as Markdown and CSV in the 'tables' field (also kept in the Markdown).",
            "default": true
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Add a 'pages' list with the text of each page and whether it was OCR'd.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size for RAG (tokens)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "Split the document into chunks of about this many tokens for embeddings and RAG, keeping headings, paragraphs and tables together. 0 = no chunks.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Tokens repeated from the end of one chunk at the start of the next (only with a chunk size).",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are skipped with an error (not charged).",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Documents in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many documents are processed at the same time. Raise the run memory for higher values.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}