{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & RAG Chunks: Document Parser (DOCX/PPTX/XLSX)",
    "description": "PDF to Markdown and RAG chunks: a document parser that turns PDF, Word (DOCX), PowerPoint (PPTX) and Excel (XLSX) into clean Markdown text for RAG and LLMs. PDF table extraction inline as Markdown tables, heading-aware chunks with page numbers. Scanned pages flagged and free. No start fee.",
    "version": "0.1",
    "x-build-id": "BSLqv0CU07iV4ArPj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lindenwerk~pdf-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lindenwerk-pdf-to-markdown-rag",
        "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/lindenwerk~pdf-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-lindenwerk-pdf-to-markdown-rag",
        "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/lindenwerk~pdf-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-lindenwerk-pdf-to-markdown-rag",
        "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": {
          "documentUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Direct links to PDF, DOCX, PPTX or XLSX files, one per line (for example the tender documents linked in your German, French, UK or SAM.gov tender monitor results). Only public http(s) addresses; robots.txt is honoured, private and internal addresses are refused.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Your files: key-value store",
            "type": "string",
            "description": "Files from your computer: in Apify Console open Storage > Key-value stores, open or create a store, upload the files as records, then pick that store here. The Actor gets read access to this store only (limited permissions)."
          },
          "keyValueStoreKeys": {
            "title": "Record keys in that store",
            "type": "array",
            "description": "Which records of the picked store to convert (e.g. offer.pdf). Leave empty to convert every record up to Max documents.",
            "items": {
              "type": "string"
            }
          },
          "base64Documents": {
            "title": "Base64 documents (API)",
            "type": "array",
            "description": "For API and AI-agent calls: [{\"fileName\": \"offer.pdf\", \"contentBase64\": \"JVBERi0...\"}]. Data URLs (data:application/pdf;base64,...) also work."
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "documents",
              "documents-and-chunks",
              "chunks"
            ],
            "type": "string",
            "description": "Chunk rows are heading-aware and carry pageStart, pageEnd and headingPath for citations. Chunks are free: you pay per document and page either way.",
            "default": "documents"
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Target size of a chunk in characters (about 4 characters per token, so 1,500 = ~375 tokens). Chunks break at headings, paragraphs and sentence ends; long tables split by rows with the header repeated.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Characters repeated from the end of the previous chunk inside the same section. Never crosses a heading. Must be below half the chunk size.",
            "default": 150
          },
          "pageMarkers": {
            "title": "Page markers in the Markdown",
            "type": "boolean",
            "description": "Adds invisible <!-- page: N --> comments so you can map text back to PDF pages, slides or sheets.",
            "default": true
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional, e.g. 1-10, 15, 20-. Applies to PDF pages, slides (PPTX), sheets (XLSX) and Word pages. Only pages in the range are converted and charged."
          },
          "removeHeadersFooters": {
            "title": "Remove running headers and footers",
            "type": "boolean",
            "description": "PDF: drops lines that repeat at the top or bottom of most pages (page numbers, document titles).",
            "default": true
          },
          "includeSlideNotes": {
            "title": "Include speaker notes",
            "type": "boolean",
            "description": "PPTX: add the speaker notes of each slide as a quote below the slide.",
            "default": true
          },
          "maxRowsPerSheet": {
            "title": "Max rows per sheet",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "XLSX: convert at most this many data rows per sheet (one sheet = one page).",
            "default": 1000
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety limit per run (hard maximum 5,000).",
            "default": 100
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages after this limit are not converted and not charged.",
            "default": 500
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped for free.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel documents",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Documents converted at the same time. 2 suits the default 512 MB of memory; raise memory with it.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Timeout per download request. 429/5xx answers are retried twice, politely.",
            "default": 60
          },
          "documentTimeoutSecs": {
            "title": "Conversion time budget per document (seconds)",
            "minimum": 30,
            "maximum": 3000,
            "type": "integer",
            "description": "A document that takes longer is returned with the pages converted so far (truncated).",
            "default": 300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}