{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Text Extractor with OCR",
    "description": "PDF to Markdown and text extractor with OCR. Convert PDF, Word, Excel, PowerPoint, HTML and scanned documents to clean Markdown with metadata and RAG ready chunks for LLMs and AI agents.",
    "version": "0.1",
    "x-build-id": "tyfuV4Ne3Vh1fmF81"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rod_analytics~doc-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rod_analytics-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/rod_analytics~doc-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-rod_analytics-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/rod_analytics~doc-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-rod_analytics-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",
        "properties": {
          "fileUrls": {
            "title": "File URLs",
            "type": "array",
            "description": "Direct links to documents: PDF, DOCX, XLSX, XLS, PPTX, HTML, EPUB, CSV, JSON, XML, TXT, images (PNG, JPG, TIFF, WEBP). Google Drive, Google Docs/Sheets/Slides, Dropbox and GitHub share links are converted to direct downloads. Shared files must be open to anyone with the link. Apify key-value store record URLs work when they are signed (recordPublicUrl).",
            "items": {
              "type": "string"
            }
          },
          "uploadedFile": {
            "title": "Upload a file",
            "type": "string",
            "description": "Upload one document from your computer. Apify stores it in a key-value store and passes its URL to the Actor. For many files, use File URLs."
          },
          "keyValueStoreRecords": {
            "title": "Uploaded files (key-value store keys)",
            "type": "array",
            "description": "Keys of records that hold files in this run's default key-value store, for example when another Actor calls this one. Use `storeId/key` or `username~store-name/key` for other stores. The Actor runs with limited permissions, so for your own stores prefer the record URL with its signature in File URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ocr": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "force",
              "off"
            ],
            "type": "string",
            "description": "`auto` runs OCR only on scanned pages that have no text layer. `force` runs OCR on every page. `off` never runs OCR. Each OCR page is billed as an extra event.",
            "default": "auto"
          },
          "languages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Tesseract language codes for OCR, for example `eng`, `deu`, `fra`, `spa`, `lit`. Several languages slow OCR down. Installed: eng, deu, fra, spa, ita, por, nld, pol, ces, slk, slv, hrv, hun, ron, bul, ell, lit, lav, est, fin, swe, dan, nor, rus, ukr, tur, ara, heb, hin, jpn, kor, chi_sim, chi_tra, vie, ind.",
            "default": [
              "eng"
            ],
            "items": {
              "type": "string"
            }
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Approximate chunk size for RAG in tokens (1 token is about 4 characters). Chunks respect headings, paragraphs and tables. Set 0 to skip chunking.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Approximate overlap between neighbouring chunks in tokens. Capped at half of the chunk size.",
            "default": 100
          },
          "includeImages": {
            "title": "Include images",
            "type": "boolean",
            "description": "Extract embedded images from PDF, DOCX and PPTX into the key-value store and link them from the Markdown. HTML image links are kept as absolute URLs. Off by default to keep the text clean for LLMs.",
            "default": false
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Process only the first N pages of each PDF, slides of each PPTX or frames of each TIFF. 0 means all pages, except that text PDFs stop at 300 pages. Set a higher number to convert longer text PDFs.",
            "default": 0
          },
          "pages": {
            "title": "PDF page range",
            "type": "string",
            "description": "Convert only these PDF pages, for example `1-5, 10, 20-` (20- means page 20 to the end). Empty means all pages. Pages that do not exist are ignored. Only applies to PDFs. Use Max pages for slides and TIFF frames."
          },
          "saveMarkdownFiles": {
            "title": "Save .md files to key-value store",
            "type": "boolean",
            "description": "Also store every document as a .md file in the key-value store. Documents longer than 200,000 characters are always stored there, and the dataset keeps a truncated copy.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip downloads larger than this.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many documents are converted in parallel. OCR is CPU heavy, so give the run more memory when you raise this.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}