{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Image OCR to Text and Markdown",
    "description": "PDF & image OCR to text and Markdown: reads the PDF text layer and runs Tesseract OCR only on scanned pages and images (PNG, JPG, TIFF, WEBP) in 19 languages. Keeps headings, lists and the ruled tables of digital PDFs. Batch URLs. From $0.001 per text page, $0.005 per OCR page; failed pages free.",
    "version": "0.1",
    "x-build-id": "yhQmPuUbW6NYRaO1s"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/klarto~pdf-ocr-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-klarto-pdf-ocr-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/klarto~pdf-ocr-markdown/runs": {
      "post": {
        "operationId": "runs-sync-klarto-pdf-ocr-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/klarto~pdf-ocr-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-klarto-pdf-ocr-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": "File URLs",
            "type": "array",
            "description": "Direct links to PDF or image files (PNG, JPEG, TIFF, WEBP, BMP, GIF), one per line, up to 1,000 per run; duplicates are read once. Public links only. Dropbox share links and Google Drive file links shared as 'anyone with the link' are converted to direct downloads. Only use files you have the right to process.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the text to OCR (up to 5). Used on every page that is OCR'd: scanned pages in Auto mode and all pages in Always mode. Not used for pages read from a PDF text layer. Pick only the languages that appear: each extra language makes OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "ukr",
                "rus",
                "bul",
                "ron",
                "hun",
                "swe",
                "dan",
                "nor",
                "fin",
                "tur"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Ukrainian",
                "Russian",
                "Bulgarian",
                "Romanian",
                "Hungarian",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Turkish"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Auto reads the PDF text layer and runs OCR only on scanned or broken pages. Always OCRs every page (use it when a PDF's text layer is wrong). Never reads only the text layer (cheapest); images then fail with an error, because they have no text layer.",
            "default": "auto"
          },
          "pageRange": {
            "title": "Pages",
            "type": "string",
            "description": "Pages to read from every document, e.g. 1-3,7,10- (1-based). Empty = all pages. For multi-page TIFF images this selects frames; a single image is page 1, so a range without page 1 gives that image an error."
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many pages of each document (after the page selection). 0 = no limit.",
            "default": 0
          },
          "includePages": {
            "title": "Add per-page text",
            "type": "boolean",
            "description": "Adds a 'pages' list with each page's number, text, method (text, ocr, empty or error) and OCR confidence (0-100). Useful for citations and RAG chunking.",
            "default": false
          },
          "removeHeadersFooters": {
            "title": "Remove repeated headers and footers",
            "type": "boolean",
            "description": "Drops short blocks (up to 100 characters) at the top or bottom of a page that repeat, digits ignored, on at least max(3, half) of the pages with text: page numbers and running titles. Needs 3 or more pages with text. A page is never emptied.",
            "default": true
          },
          "autoRotate": {
            "title": "Auto-rotate scans",
            "type": "boolean",
            "description": "Detects pages and photos that are turned 90 or 180 degrees and rotates them before OCR.",
            "default": true
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 150,
            "maximum": 400,
            "type": "integer",
            "description": "Resolution used to render PDF pages for OCR. 300 suits most documents; 400 helps tiny print; 200 is faster.",
            "default": 300
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this get status 'error' and are not charged (1-500 MB).",
            "default": 100
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for encrypted PDFs (the same password is tried for every PDF in the run). Leave empty otherwise."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}