{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown API: Word, Excel, PPTX for RAG",
    "description": "PDF to markdown API for RAG and LLMs. Converts PDF, Word (DOCX), Excel, PowerPoint, CSV and web pages from public links into clean markdown with token counts and optional ready-to-embed chunks. Pay only for documents that convert.",
    "version": "0.1",
    "x-build-id": "DAqVdIuel03UNWw2R"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jackalalpha~docs-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jackalalpha-docs-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/jackalalpha~docs-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-jackalalpha-docs-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/jackalalpha~docs-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-jackalalpha-docs-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",
            "maxItems": 1000,
            "type": "array",
            "description": "Public http(s) links to documents, one per line: PDF, DOCX, XLSX, PPTX, CSV, HTML, Markdown or plain text. Links to private or internal addresses are refused.",
            "items": {
              "type": "string"
            }
          },
          "recordKeys": {
            "title": "Key-value store record keys (optional)",
            "maxItems": 1000,
            "type": "array",
            "description": "Keys of files you uploaded to a key-value store. The file type is taken from the content and the key extension (for example report.pdf).",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (optional)",
            "type": "string",
            "description": "ID or name of the store that holds the record keys above. Leave empty to use this run's default store."
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Convert only the first N pages (PDF) or slides (PPTX). Default 500, maximum 5000. Documents cut short are marked truncated.",
            "default": 500
          },
          "maxRowsPerSheet": {
            "title": "Max rows per sheet",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Rows kept per sheet or CSV file after the header row. Extra rows are dropped and the document is marked truncated. 0 means the maximum, 100000.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Files larger than this are rejected while downloading, without being charged.",
            "default": 25
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Set above 0 to also return the markdown split into chunks of at most this many characters, cut at headings and paragraphs. 0 turns chunking off. About 4 characters make 1 token.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Characters repeated from the end of the previous chunk at the start of the next one. Capped at half the chunk size.",
            "default": 0
          },
          "includeMetadataOnly": {
            "title": "Metadata only",
            "type": "boolean",
            "description": "Leave out the markdown and chunks and return only type, title, counts and sizes. Converted documents are still charged.",
            "default": false
          },
          "ocr": {
            "title": "OCR for scanned pages",
            "type": "boolean",
            "description": "Read pages that have no text layer (scanned or image-only PDFs) with OCR. Slower and less exact than real text, and tables in scans are not rebuilt. Off by default: a scanned PDF then fails with a clear error and is not charged.",
            "default": false
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the scanned text. Use Arabic alone for Arabic documents: mixing languages lowers accuracy.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "ara"
              ],
              "enumTitles": [
                "English",
                "Arabic"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrMaxPages": {
            "title": "Max OCR pages per document",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "OCR is slow, so only the first N pages without text are read. The rest stay empty and the document is marked truncated.",
            "default": 20
          },
          "imageMode": {
            "title": "Images in Word files",
            "enum": [
              "placeholder",
              "inline",
              "drop"
            ],
            "type": "string",
            "description": "Placeholder keeps each picture's position and alt text as a markdown image link (image-1.png). Inline embeds the picture as a data URI. Drop removes pictures.",
            "default": "placeholder"
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Documents converted in parallel.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum time to download one document.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}