{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor & PDF to Markdown: Tables, OCR, RAG",
    "description": "PDF text extractor and PDF to Markdown converter for LLMs: clean Markdown, tables as CSV, RAG chunks with page numbers, and OCR for scanned pages. Also Word, PowerPoint, Excel, HTML, EPUB and images. A 10-page text PDF costs about $0.008. Failed files are not charged.",
    "version": "0.1",
    "x-build-id": "1NlcoicVWQgsQ6EAn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigkerm~document-to-markdown-tables-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigkerm-document-to-markdown-tables-ocr",
        "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/bigkerm~document-to-markdown-tables-ocr/runs": {
      "post": {
        "operationId": "runs-sync-bigkerm-document-to-markdown-tables-ocr",
        "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/bigkerm~document-to-markdown-tables-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-bigkerm-document-to-markdown-tables-ocr",
        "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 links",
            "type": "array",
            "description": "Links to PDF, DOCX, PPTX, XLSX, XLS, HTML, CSV, JSON, EPUB, TXT, Markdown or image (PNG, JPG, TIFF) files, one per line. Public Google Drive, Google Docs, Sheets and Slides, Dropbox, GitHub and arXiv share links are turned into direct downloads. Redirects are followed (up to 10). The file type is detected from the content, not the name. Private network addresses are blocked.",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "title": "Uploaded files",
            "type": "array",
            "description": "Optional. Upload files to a key-value store from this field instead of using a public link. Each upload becomes a link that is downloaded like the ones above.",
            "items": {
              "type": "string"
            }
          },
          "outputs": {
            "title": "What to return",
            "type": "array",
            "description": "markdown: whole document as Markdown. text: plain text. tables: every table as rows, Markdown and a CSV file. pages: Markdown per page. chunks: RAG-ready chunks. The full files are always saved in the key-value store as well.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "tables",
                "pages",
                "chunks"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "Tables",
                "Per-page Markdown",
                "RAG chunks"
              ]
            },
            "default": [
              "markdown",
              "tables",
              "chunks"
            ]
          },
          "ocr": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "off",
              "force"
            ],
            "type": "string",
            "description": "auto: read only pages that have no usable text layer (scans). off: never OCR (scanned pages come back empty and are not charged). force: OCR every page, even those with text.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the scanned text. Using only the languages you need is faster and more accurate.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "spa",
                "fra",
                "deu",
                "por",
                "ita",
                "nld"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "French",
                "German",
                "Portuguese",
                "Italian",
                "Dutch"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Only convert these pages (or slides, or sheets), for example 1-5, 8, 12-. Empty means all. Skipped pages are not charged. Does not apply to DOCX, HTML, TXT and other documents without fixed pages.",
            "default": ""
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages beyond this are skipped (the document is then marked partial) and not charged.",
            "default": 300
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are not downloaded fully and are not charged (status too-large).",
            "default": 100
          },
          "maxOcrPagesPerDocument": {
            "title": "Max OCR pages per document",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "OCR is the slowest and most expensive step. After this many OCR pages the document stops and is marked partial.",
            "default": 100
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 50,
            "maximum": 8000,
            "type": "integer",
            "description": "Target size of each RAG chunk. Tokens are estimated as characters divided by 4. Chunks break at paragraph, list and table boundaries and start a new chunk at a heading once half full.",
            "default": 800
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "How much of the end of one chunk is repeated at the start of the next.",
            "default": 100
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs. Stored encrypted. Used for every document in this run."
          },
          "maxConcurrency": {
            "title": "Documents at the same time",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many documents are converted in parallel. Each OCR document can use several hundred MB of memory.",
            "default": 3
          },
          "timeoutPerDocumentSecs": {
            "title": "Timeout per document (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Download plus conversion. A document that runs out of time keeps the pages it finished and is marked partial.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}