{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown for RAG — DOCX, OCR & Chunks",
    "description": "Convert PDF, DOCX, PPTX, XLSX, EPUB, HTML, text and image URLs into clean Markdown with headings, tables, links and metadata, plus optional RAG chunks, OCR in 21 languages, table CSVs and embedded images. No browser, no external API. Pay per page converted ($0.001).",
    "version": "0.1",
    "x-build-id": "oeXwd454h4iQJcKLr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/owlabee~pdf-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-owlabee-pdf-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/owlabee~pdf-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-owlabee-pdf-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/owlabee~pdf-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-owlabee-pdf-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",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Documents to convert, one per line: public http(s) URLs of PDF, DOCX, PPTX, XLSX/XLSM, OpenDocument (ODT, ODP, ODS), EPUB, HTML, Markdown, plain-text or CSV files, or images (PNG, JPEG, GIF, WebP, TIFF, BMP, AVIF, HEIC; read with OCR), Apify key-value-store references in the form kvs://<storeId>/<key> (use kvs://default/<key> for this run's own store), or data: URLs with inline base64 content. Each entry becomes one document record. The prefilled PDFs are small public files used by Apify's daily automated test.",
            "items": {
              "type": "string"
            }
          },
          "chunk": {
            "title": "Create RAG chunks",
            "type": "boolean",
            "description": "Also emit one chunk record per heading-aware chunk of the Markdown (recordType: chunk) with chunkIndex, startPage, endPage, headingPath and tokensEstimate — ready for embedding pipelines. Each chunk is charged separately ($0.0002).",
            "default": false
          },
          "chunkTokens": {
            "title": "Chunk size (tokens)",
            "minimum": 100,
            "maximum": 8000,
            "type": "integer",
            "description": "Target size of each chunk in estimated tokens (~4 characters per token). Blocks such as tables and paragraphs are kept whole where possible; headings start new chunks once a chunk is half full.",
            "default": 800
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "How much of the previous chunk's tail is repeated at the start of the next chunk, in estimated tokens. Capped at half the chunk size.",
            "default": 80
          },
          "ocr": {
            "title": "OCR scanned pages and images",
            "type": "boolean",
            "description": "When a PDF page has no extractable text (scanned or image-only), or the input is an image, render it and run OCR (tesseract, bundled, no external API) in the languages chosen below. Pages that would need OCR are always listed in needsOcrPages; this toggle decides whether they are actually recognized. OCR'd pages cost $0.005 each on top of the page price and take 2–5 s per page.",
            "default": false
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "uniqueItems": true,
            "type": "array",
            "description": "Languages OCR reads, as tesseract codes; pick up to 3 (more slows recognition). All models are bundled in the Actor, nothing is downloaded. Default: English. Supported: eng, spa, fra, deu, por, ita, nld, pol, rus, ukr, tur, ara, hin, chi_sim, chi_tra, jpn, kor, vie, ind, tha, heb.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "spa",
                "fra",
                "deu",
                "por",
                "ita",
                "nld",
                "pol",
                "rus",
                "ukr",
                "tur",
                "ara",
                "hin",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "vie",
                "ind",
                "tha",
                "heb"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "French",
                "German",
                "Portuguese",
                "Italian",
                "Dutch",
                "Polish",
                "Russian",
                "Ukrainian",
                "Turkish",
                "Arabic",
                "Hindi",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Japanese",
                "Korean",
                "Vietnamese",
                "Indonesian",
                "Thai",
                "Hebrew"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "extractTables": {
            "title": "Extract tables as records",
            "type": "boolean",
            "description": "Also emit one table record per table found (recordType: table) with its page, heading path, column names and rows as objects, and write each table as a CSV file into the run's default key-value store (csvKey). Covers PDF layout tables, DOCX/HTML/slide tables, spreadsheet sheets and CSV inputs. Free: no extra charge.",
            "default": false
          },
          "extractImages": {
            "title": "Extract embedded images",
            "type": "boolean",
            "description": "Save the pictures embedded in PDF, DOCX, PPTX, OpenDocument and EPUB files into the run's default key-value store, list them in the document record's images field and reference them in the Markdown. Icons smaller than 32 px are skipped; an image reused on several pages is saved once. Each saved image costs $0.0005.",
            "default": false
          },
          "maxImagesPerDocument": {
            "title": "Max images per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Stop saving embedded images after this many per document (only with extractImages on). Bounds the cost of an image-heavy file.",
            "default": 50
          },
          "saveToKeyValueStore": {
            "title": "Save Markdown files to the key-value store",
            "type": "boolean",
            "description": "Also write each document's full Markdown as <slug>.md into the run's default key-value store and record the key as kvsKey. Useful for documents whose Markdown is too large to read comfortably from the dataset.",
            "default": false
          },
          "pageBreaks": {
            "title": "Keep page markers",
            "type": "boolean",
            "description": "Insert <!-- page N --> comments between PDF pages so chunks and citations can reference page numbers. Turn off for Markdown without any HTML comments.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Files larger than this are rejected with a TOO_LARGE error item instead of being downloaded. Raise it up to 50 MB for large scans; bigger files need more memory.",
            "default": 25
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to download one file before it is recorded as a TIMEOUT error item.",
            "default": 20
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "If set, the Actor POSTs a JSON summary of the run (documents, errors, pages, chunks, charges) to this URL when it finishes. Failures are logged, never fatal."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}