{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF OCR – Scanned PDF to Searchable PDF & Text",
    "description": "OCR scanned PDFs and images into searchable PDFs (invisible text layer over the original pages) plus full text, per-page text and Markdown. Tesseract 5, 22 languages, only pages without a text layer are OCR'd, confidence per page. $4.50 per 1,000 OCR pages.",
    "version": "0.1",
    "x-build-id": "PHbNvFqVj5it7X9yT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~pdf-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-pdf-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/gazidev~pdf-ocr/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-pdf-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/gazidev~pdf-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-pdf-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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to scanned (or mixed) PDF files, one per line. Each PDF becomes one searchable PDF. Google Drive / Dropbox share links and GitHub `blob` links are converted to direct downloads automatically.",
            "default": [
              "https://archive.org/download/IAPSOP-Plummer_to_Crowley_January_7_1914/IAPSOP-Plummer_to_Crowley_January_7_1914.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "imageUrls": {
            "title": "Image URLs (scans / photos of pages)",
            "type": "array",
            "description": "Optional. JPG, PNG, TIFF (multi-page), WebP, GIF, BMP or HEIC scans. By default all images are combined, in this order, into ONE searchable PDF (one page per image). JPEGs are embedded without re-compression.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "combineImages": {
            "title": "Combine all images into one PDF",
            "type": "boolean",
            "description": "On: all image URLs become one multi-page searchable PDF. Off: one searchable PDF per image.",
            "default": true
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the scanned text. Pick 1-3: more languages are slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "tur",
                "pol",
                "rus",
                "ukr",
                "ces",
                "swe",
                "ron",
                "ara",
                "hin",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "ind",
                "vie"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Turkish",
                "Polish",
                "Russian",
                "Ukrainian",
                "Czech",
                "Swedish",
                "Romanian",
                "Arabic",
                "Hindi",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Japanese",
                "Korean",
                "Indonesian",
                "Vietnamese"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "force"
            ],
            "type": "string",
            "description": "`auto`: only pages without a usable text layer (scans, photos, broken font encodings) are OCR'd and charged as `ocr-page`; pages that already have text are kept as they are and charged as the cheap `text-page`. `force`: OCR every page. In force mode an existing invisible OCR layer (from another tool) is replaced; pages with visible digital text are OCR'd for the text output but no second layer is added on top.",
            "default": "auto"
          },
          "dpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 100,
            "maximum": 600,
            "type": "integer",
            "description": "Pages are rendered at this resolution for OCR. 300 is best for normal print; 200 is about 20% faster; 400 helps with very small text. The original page image in the PDF is never changed.",
            "default": 300
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional. Pages to process, e.g. `1-5`, `1,3,10-`, or `-3--1` for the last three pages. Empty = all pages (up to `Max pages per PDF`). Other pages stay in the PDF unchanged and are not charged."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on processed pages per PDF (after the page range). 0 = no limit.",
            "default": 500
          },
          "saveSearchablePdf": {
            "title": "Save the searchable PDF",
            "type": "boolean",
            "description": "Save each searchable PDF in the run's key-value store, linked from the dataset row (`searchablePdfUrl`).",
            "default": true
          },
          "saveTextFiles": {
            "title": "Save .txt and .md files",
            "type": "boolean",
            "description": "Also save the full text (.txt) and Markdown with re-flowed paragraphs and page markers (.md) for every PDF.",
            "default": true
          },
          "includePageTexts": {
            "title": "Per-page text in the dataset",
            "type": "boolean",
            "description": "Add a `pages` array to each row: page number, method (ocr / text / empty), OCR confidence, word count and the page text.",
            "default": true
          },
          "maxCharsPerItem": {
            "title": "Max characters in dataset text fields",
            "minimum": 1000,
            "type": "integer",
            "description": "Longer text is cut in the dataset (`textTruncated: true`). The complete text is always in the saved .txt/.md files and in the searchable PDF.",
            "default": 100000
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Optional. Password for encrypted PDFs (used for all PDFs of the run)."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with a free error row.",
            "default": 100
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout for one download. Failed downloads (timeouts, HTTP 429/5xx) are retried 3 times with backoff.",
            "default": 120
          },
          "maxConcurrentDownloads": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Files downloaded in parallel while earlier ones are OCR'd.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}