{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & RAG Chunks: Word, Excel, PowerPoint",
    "description": "PDF to Markdown converter for RAG and LLMs: turn PDF, Word (DOCX), PowerPoint (PPTX), Excel (XLSX) and HTML files into clean Markdown, JSON blocks or page-cited RAG chunks. Tables kept, headers and footers removed, scans flagged for OCR. No GPU, no setup.",
    "version": "0.1",
    "x-build-id": "g7qfZjqY5MAtu3UOv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quarrywise~pdf-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quarrywise-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/quarrywise~pdf-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-quarrywise-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/quarrywise~pdf-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-quarrywise-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 links",
            "maxItems": 1000,
            "type": "array",
            "description": "Links to PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, Markdown, plain text or CSV files, one per line. Public links and signed links (for example from cloud storage) work. Links behind a login, and links to social media or video sites, are not supported. If a server refuses access, the document gets an error row; the Actor never tries to get around it.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload documents from your computer instead of giving links. Uploaded files are read from your Apify storage and processed only for this run."
          },
          "outputFormat": {
            "title": "Output",
            "enum": [
              "markdown",
              "blocks",
              "chunks"
            ],
            "type": "string",
            "description": "Markdown: one row per document with the full Markdown. JSON blocks: one row per document with a list of headings, paragraphs, list items and tables, each with its page number and heading path. RAG chunks: one row per chunk, ready for embedding, with source, page range, heading path and a token estimate.",
            "default": "markdown"
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 64,
            "maximum": 8000,
            "type": "integer",
            "description": "Target size of each chunk in tokens (estimated at about 4 characters per token). Chunks follow headings: a section is only split when it is longer than this. Used when Output is RAG chunks.",
            "default": 500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How much text from the end of a chunk is repeated at the start of the next chunk of the same section, in whole sentences. At most half the chunk size.",
            "default": 50
          },
          "chunkHeadingContext": {
            "title": "Start each chunk with its headings",
            "type": "boolean",
            "description": "When on, each chunk starts with the headings it belongs to (for example '# Annual report' and '## 3 Costs'), so a chunk still makes sense on its own after retrieval.",
            "default": true
          },
          "pageRange": {
            "title": "Page range",
            "pattern": "^[0-9 ,-]*$",
            "maxLength": 200,
            "type": "string",
            "description": "Convert only these pages or slides, for example '1-5, 8, 10-'. Leave empty for all pages. Applies to PDF files and slide decks."
          },
          "maxPages": {
            "title": "Maximum pages per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop each PDF or slide deck after this many pages (within the page range). Protects your budget from unexpectedly long files.",
            "default": 300
          },
          "removeHeadersFooters": {
            "title": "Remove running headers, footers and page numbers",
            "type": "boolean",
            "description": "Removes lines that repeat at the top or bottom of PDF pages (running headers, footers, page numbers) so they do not end up inside your text and chunks. Word headers and footers are always left out.",
            "default": true
          },
          "pageMarkers": {
            "title": "Add page markers to the Markdown",
            "type": "boolean",
            "description": "Adds an HTML comment such as '<!-- page 3 -->' where each PDF page or slide starts.",
            "default": false
          },
          "includeSpeakerNotes": {
            "title": "Include speaker notes (PowerPoint)",
            "type": "boolean",
            "description": "Adds each slide's speaker notes after the slide content.",
            "default": true
          },
          "includeHiddenSheets": {
            "title": "Include hidden sheets (Excel)",
            "type": "boolean",
            "description": "Hidden sheets are skipped by default because they often hold drafts or lookups.",
            "default": false
          },
          "maxRowsPerSheet": {
            "title": "Maximum rows per sheet or CSV file",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Rows after this are left out (a warning says so).",
            "default": 5000
          },
          "saveMarkdownFiles": {
            "title": "Also save each document as a .md file",
            "type": "boolean",
            "description": "Saves each document's Markdown in the run's key-value store and adds its link (markdown_file_url) to the results. Very large documents are always saved this way.",
            "default": false
          },
          "keyValueStoreId": {
            "title": "Key-value store with your files",
            "type": "string",
            "description": "Optional. A key-value store that holds documents as records. With record keys below, only those records are converted; without keys, every record is converted (up to the maximum number of documents). The Actor only reads this store."
          },
          "fileKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Keys of records that hold documents: in the store chosen above, or in this run's own default key-value store when no store is chosen.",
            "items": {
              "type": "string"
            }
          },
          "base64Files": {
            "title": "Base64 files",
            "type": "array",
            "description": "Small files sent inside the input, as a list of objects: [{\"fileName\": \"notes.pdf\", \"contentBase64\": \"JVBERi0...\"}]. The run input has a size limit, so use links or uploads for large files."
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped with an error row. The hard limit is 100 MB.",
            "default": 50
          },
          "maxDocuments": {
            "title": "Maximum documents per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Only the first documents up to this number are converted.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}