{
  "openapi": "3.0.1",
  "info": {
    "title": "Document to Markdown: PDF, DOCX, XLSX for LLMs & RAG",
    "description": "Tested Oct 25, 2026: 99.9% text fidelity on our test PDFs, 99.3% reading order on 2-column PDFs (MarkItDown 84%), PDF tables as real grids (cell placement 0.70, same as Docling). PDF, DOCX, XLSX, HTML to markdown with token counts. $0.001/page, failures free.",
    "version": "1.0",
    "x-build-id": "Bf4a39dVhDWCzXoUx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/catalyst-labs~document-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-catalyst-labs-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/catalyst-labs~document-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-catalyst-labs-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/catalyst-labs~document-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-catalyst-labs-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 PDF, DOCX, XLSX, XLS, CSV, HTML, TXT or MD files (max 100 per call). Type is detected from the file bytes, not the extension. Each document returns exactly one row with `outcome`; failures (404, blocked, scanned PDF, encrypted) are rows, never charged.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Files (base64)",
            "type": "array",
            "description": "Optional inline files for agents that hold the bytes: `[{\"name\": \"report.pdf\", \"base64\": \"...\"}]`. Keep under ~9 MB total (input size limit)."
          },
          "maxChars": {
            "title": "Max characters per document",
            "minimum": 0,
            "type": "integer",
            "description": "Budget per document: markdown is cut at a paragraph boundary to this many characters; 0 = no limit. Default 50000 (about 13,000 tokens; each row reports exact `tokens`). You pay only for the pages actually returned.",
            "default": 50000
          },
          "pages": {
            "title": "PDF page range",
            "type": "string",
            "description": "PDF only: pages to convert, e.g. `1-10`, `5`, `20-`. Default all (up to maxPages)."
          },
          "maxPages": {
            "title": "Max PDF pages",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap on PDF pages per document. Default 200.",
            "default": 200
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "For RAG: split each document into chunks of about this many characters on heading/paragraph boundaries. Each chunk has exact `tokens`, `charStart`/`charEnd` offsets, `headingPath` (all parent headings) and PDF `page`. 0 = off (default).",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters repeated between consecutive chunks. Default 200.",
            "default": 200
          },
          "pdfTables": {
            "title": "PDF tables as markdown tables",
            "enum": [
              "auto",
              "off"
            ],
            "type": "string",
            "description": "`auto` (default) finds tables on PDF pages that look tabular, using the same engine as catalyst-labs/pdf-tables-to-json, and writes them as GFM tables in place. Text-only PDFs are not slowed down. `off` is the old, fastest behaviour.",
            "default": "auto"
          },
          "includeFullMarkdown": {
            "title": "Return full markdown with chunks",
            "type": "boolean",
            "description": "When chunking, also return the whole `markdown` field (doubles output size). Off by default.",
            "default": false
          },
          "pageMarkers": {
            "title": "PDF page markers",
            "type": "boolean",
            "description": "Insert `<!-- page N -->` before each PDF page so citations can point at a page.",
            "default": true
          },
          "keepLinks": {
            "title": "Keep hyperlinks",
            "type": "boolean",
            "description": "Keep `[text](url)` links from DOCX/HTML. Off saves tokens.",
            "default": false
          },
          "maxRowsPerSheet": {
            "title": "Max rows per sheet",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Spreadsheets: rows per sheet rendered as a markdown table. Default 500.",
            "default": 500
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-document download timeout. Default 60.",
            "default": 60
          },
          "referrer_id": {
            "title": "Referral code (optional)",
            "type": "string",
            "description": "Referral code from another user's receipt (ref_...). They earn 10% of this run's price as credit."
          },
          "buyerPublicKey": {
            "title": "Your verdict public key (optional)",
            "type": "string",
            "description": "Base64 Ed25519 public key (SPKI). Lets you sign a useful/not useful verdict on this run's receipt for 5% off your next run."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}