{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR: Image & Scanned PDF to Text (Tesseract, 40 languages)",
    "description": "Bulk OCR for images and scanned PDFs: image to text and scanned PDF to text in 40 languages with Tesseract 5. Per-page text, confidence score, optional word bounding boxes and hOCR. Auto-rotation, smart PDF text-layer mode. Blank pages and errors are free.",
    "version": "0.1",
    "x-build-id": "lzz4XVJuCIfeJXjlH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/timeout~ocr-image-pdf-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-timeout-ocr-image-pdf-to-text",
        "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/timeout~ocr-image-pdf-to-text/runs": {
      "post": {
        "operationId": "runs-sync-timeout-ocr-image-pdf-to-text",
        "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/timeout~ocr-image-pdf-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-timeout-ocr-image-pdf-to-text",
        "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": {
          "sources": {
            "title": "Image or PDF URLs",
            "type": "array",
            "description": "Public http(s) links to images (PNG, JPEG, TIFF incl. multi-page, WEBP, GIF, BMP) or PDFs (scanned or digital). One dataset item is returned per page.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Languages of the text. Put the main language first; pick only the languages that actually appear (each extra language makes OCR slower and can lower accuracy).",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "spa",
                "deu",
                "fra",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "slk",
                "ron",
                "hun",
                "tur",
                "swe",
                "dan",
                "nor",
                "fin",
                "cat",
                "glg",
                "eus",
                "ell",
                "rus",
                "ukr",
                "bul",
                "hrv",
                "srp_latn",
                "slv",
                "lit",
                "lav",
                "est",
                "ara",
                "heb",
                "hin",
                "vie",
                "ind",
                "tha",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "German",
                "French",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Slovak",
                "Romanian",
                "Hungarian",
                "Turkish",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Catalan",
                "Galician",
                "Basque",
                "Greek",
                "Russian",
                "Ukrainian",
                "Bulgarian",
                "Croatian",
                "Serbian (Latin)",
                "Slovenian",
                "Lithuanian",
                "Latvian",
                "Estonian",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Vietnamese",
                "Indonesian",
                "Thai",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pdfMode": {
            "title": "PDF mode",
            "enum": [
              "auto",
              "ocr"
            ],
            "type": "string",
            "description": "auto: pages that already have a text layer are extracted directly (cheaper, exact), other pages are OCR'd. ocr: always render and OCR every page.",
            "default": "auto"
          },
          "includeWords": {
            "title": "Include words with bounding boxes",
            "type": "boolean",
            "description": "Add words[] with text, confidence (0-100), bbox [x0,y0,x1,y1] in pixels of the OCR'd image, block and line number.",
            "default": false
          },
          "includeHocr": {
            "title": "Include hOCR",
            "type": "boolean",
            "description": "Add the hOCR (HTML with layout and coordinates) of each OCR'd page.",
            "default": false
          },
          "autoRotate": {
            "title": "Auto-rotate pages",
            "type": "boolean",
            "description": "Detect pages scanned sideways or upside down (90/180/270 degrees) and rotate them before OCR.",
            "default": true
          },
          "upscaleSmallImages": {
            "title": "Upscale small images",
            "type": "boolean",
            "description": "Images under 1000 px are enlarged before OCR (improves small text such as screenshots and thumbnails).",
            "default": true
          },
          "pageSegmentation": {
            "title": "Page layout",
            "enum": [
              "auto",
              "single-column",
              "single-block",
              "sparse-text",
              "single-line"
            ],
            "type": "string",
            "description": "How Tesseract splits the page. 'auto' fits documents; 'sparse-text' fits photos, receipts and screenshots with scattered text; 'single-line' fits one-line crops.",
            "default": "auto"
          },
          "pdfDpi": {
            "title": "PDF render resolution (DPI)",
            "minimum": 100,
            "maximum": 600,
            "type": "integer",
            "description": "Resolution used to render scanned PDF pages for OCR. 300 is the standard; use 400 for very small print.",
            "default": 300
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for protected PDFs (applied to all PDFs in the run)."
          },
          "keyValueStoreKeys": {
            "title": "Key-value store keys (optional)",
            "type": "array",
            "description": "Process files stored as records in an Apify key-value store (for example saved by another Actor or via the API) instead of, or in addition to, URLs.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store ID or name (optional)",
            "type": "string",
            "description": "Key-value store that holds the keys above (pick it, or paste its ID). Empty = this run's default key-value store."
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety cap on the number of files processed in one run.",
            "default": 100
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Only the first N pages of each PDF / multi-page TIFF are processed.",
            "default": 50
          },
          "maxTotalPages": {
            "title": "Max pages per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap on the total pages (and therefore cost) of one run.",
            "default": 500
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are skipped with an error item (not charged).",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}