{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown, PDF Text Extractor: Word to Markdown for RAG",
    "description": "Extract text from PDF files and convert PDF, Word DOCX, PowerPoint PPTX, Excel XLSX and HTML files to clean Markdown for AI pipelines, one row per document. Ruled PDF tables become Markdown tables or an Excel file, with optional RAG chunks. No OCR, so scanned pages come back empty.",
    "version": "0.1",
    "x-build-id": "k6PoAJlw3uVvarF9L"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plainrecordlabs~docs-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plainrecordlabs-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/plainrecordlabs~docs-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-plainrecordlabs-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/plainrecordlabs~docs-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-plainrecordlabs-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Direct links to PDF, DOCX, PPTX, XLSX, HTML, CSV or text files, for example https://www.irs.gov/pub/irs-pdf/fw9.pdf. Sites whose robots.txt disallows automated access are skipped. A file that cannot be read is listed in the run summary and the other files still convert.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "chunks": {
            "title": "Add RAG chunks",
            "type": "boolean",
            "description": "Also split each document's Markdown into chunks at paragraph boundaries, ready for embedding. The chunks go in a chunks list on each result, next to the full Markdown. A PDF's chunks also carry pageStart and pageEnd, the pages their text comes from. For example, turn it on to load the chunks straight into a vector store.",
            "default": false
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "type": "integer",
            "description": "Target length of each chunk in characters, not tokens, for example 2000. In English text 2,000 characters is roughly 400 to 500 tokens. Chunks break between paragraphs, so most come out a little under the target, and one long paragraph or table can make a chunk up to about one and a half times the target.",
            "default": 2000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "type": "integer",
            "description": "Characters carried over from the end of one chunk to the start of the next, for example 200, so text near a boundary appears in both chunks. Keep it well under Chunk size.",
            "default": 200
          },
          "pageMarkers": {
            "title": "Mark PDF page breaks",
            "type": "boolean",
            "description": "Insert a <!-- page N --> comment before each PDF page, so you can cite page numbers, for example page 3 of a report. The comment does not show when the Markdown is rendered.",
            "default": false
          },
          "pageRange": {
            "title": "PDF page range",
            "pattern": "^\\s*$|^\\s*\\d+\\s*(-\\s*\\d*\\s*)?(,\\s*\\d+\\s*(-\\s*\\d*\\s*)?)*$",
            "type": "string",
            "description": "Convert only these pages of each PDF, for example 1-3,7 for pages 1, 2, 3 and 7, or 10- for page 10 to the end. Leave it empty to start at page 1. Pages come back in page order, and you pay only for the pages converted. Pages past the end of a PDF are skipped. Max PDF pages per document still caps how many pages are read."
          },
          "maxPages": {
            "title": "Max PDF pages per document",
            "minimum": 1,
            "type": "integer",
            "description": "Convert at most this many pages of each PDF, for example 20 to read only the start of long reports. With a PDF page range, it caps the pages read from that range. You pay per page converted. Each result's pagesConverted field shows how many pages were read.",
            "default": 200
          },
          "maxFileMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "type": "integer",
            "description": "Skip any file larger than this many megabytes, for example 50. Skipped files are listed in the run summary.",
            "default": 50
          },
          "xlsxTables": {
            "title": "Excel file of PDF tables",
            "type": "boolean",
            "description": "Also write the ruled tables found in each PDF to an Excel (.xlsx) file, one sheet per table, named by page, like Page 3 table 1. Plain numbers, dollar amounts and percents become real numbers. Each result gets an xlsxUrl download link, and the file sits in the run's key-value store. Tables drawn without lines are not found. There is no extra charge.",
            "default": false
          },
          "plainText": {
            "title": "Add plain text",
            "type": "boolean",
            "description": "Also return each document as plain text in a text field, next to the Markdown. Table rows become cells split by tabs, and heading, link and bold marks are left out. For example, turn it on to feed text to a tool that does not read Markdown.",
            "default": false
          },
          "perPageText": {
            "title": "Add text per PDF page",
            "type": "boolean",
            "description": "Also return a pages list for each PDF, with each converted page's number and its plain text, for example to cite page 3 of a report. Pages with no text come back with empty text. Other file types get no pages list.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}