{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR - Scanned PDF, HEIC, Screenshot + Translate",
    "description": "Convert image to text or screenshot to text. OCR PDF scans, photos and iPhone HEIC in 126 languages (text layer first), with optional offline translation into 29 languages. Get text, lines, word boxes, PDF tables and metadata. Batch (URLs, base64, datasets, CSV lists) or REST API. No Google Lens.",
    "version": "1.7",
    "x-build-id": "xshtwzpBYSBExBWzD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gochujang~image-ocr-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gochujang-image-ocr-extractor",
        "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/gochujang~image-ocr-extractor/runs": {
      "post": {
        "operationId": "runs-sync-gochujang-image-ocr-extractor",
        "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/gochujang~image-ocr-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-gochujang-image-ocr-extractor",
        "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": "Image/PDF URLs",
            "type": "array",
            "description": "Required: put the image or PDF URLs here (or use url / imagesBase64). Public image or PDF URLs for OCR image to text, OCR PDF, or screenshot to text (PNG, JPG, WebP, TIFF, BMP, HEIC/HEIF iPhone photos, PDF). For a small test use https://jeroen.github.io/images/testocr.png. Google Drive and Dropbox share links are resolved to downloads.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "url": {
            "title": "Single image/PDF URL (shortcut)",
            "type": "string",
            "description": "Single public image or PDF URL for image to text, used when urls is empty; for example https://jeroen.github.io/images/testocr.png.",
            "default": ""
          },
          "sourceListUrls": {
            "title": "Source list URLs (CSV / TXT / JSON)",
            "type": "array",
            "description": "URLs of files that list image or document URLs: a CSV (the column named in sourceListUrlField, else every URL cell), a TXT (one URL per line) or a JSON array (URL strings or objects). The listed URLs are merged with urls. Each list is downloaded with the same size cap as images (maxImageSizeMb); a list that cannot be read gives one uncharged error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sourceListUrlField": {
            "title": "Source list URL field",
            "type": "string",
            "description": "CSV column or JSON field holding the URL in each source list entry. Dotted paths such as media.src work for JSON.",
            "default": "url"
          },
          "maxSourceListItems": {
            "title": "Max URLs from source lists",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of URLs read from all source lists together (1-10000). The overall limit (Max images) still applies.",
            "default": 200
          },
          "imagesBase64": {
            "title": "Images as base64",
            "type": "array",
            "description": "Images (or PDFs) as base64 strings or data: URIs, e.g. \"data:image/png;base64,iVBOR...\". Use when the file is not at a public URL. Each entry gives one result row (a PDF gives one row per page). Rows are labelled base64:1, base64:2, ...",
            "default": []
          },
          "documentUrls": {
            "title": "PDF / document URLs (one row per page)",
            "type": "array",
            "description": "Public PDF URLs. Each page becomes its own row with a page number. Pages that already have a text layer are read directly (source: text_layer, no OCR); scanned pages are rendered and OCR'd (source: ocr). Image URLs here are OCR'd as one row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPdfPages": {
            "title": "Max PDF pages per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of pages read from each PDF in documentUrls or imagesBase64 (1-500).",
            "default": 20
          },
          "pdfTextMode": {
            "title": "PDF text mode",
            "enum": [
              "auto",
              "ocr",
              "text"
            ],
            "type": "string",
            "description": "'auto' reads a PDF page's embedded text layer and OCRs the page only when that layer has fewer than minTextLayerChars visible characters; much faster on digital PDFs. 'ocr' renders and OCRs every page. 'text' never OCRs (a page without a text layer gives an uncharged no_text_layer error). Each PDF page reports page_text_source: text_layer or ocr. Text-layer pages bill the same event as OCR'd pages.",
            "default": "auto"
          },
          "minTextLayerChars": {
            "title": "Min text-layer characters",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "In auto mode, a page whose text layer has fewer visible (non-space) characters than this is OCR'd instead, so a page with only a page number or footer is still read.",
            "default": 20
          },
          "pdfDpi": {
            "title": "PDF render DPI",
            "minimum": 72,
            "maximum": 400,
            "type": "integer",
            "description": "Resolution used to render PDF pages for OCR (72-400). Higher reads small print better but is slower.",
            "default": 200
          },
          "extractTables": {
            "title": "Extract PDF tables",
            "type": "boolean",
            "description": "Add pdf_tables to each PDF result: ruled tables found by pdfplumber on each page, as rows of cell strings. Works on PDFs with a text layer. Off by default (output unchanged).",
            "default": false
          },
          "extractMetadata": {
            "title": "Extract file metadata",
            "type": "boolean",
            "description": "Add a metadata object: for images width, height, format, colour mode and EXIF orientation; for PDFs page count, encryption flag and the info dictionary (title, author, creator, dates). Off by default (output unchanged).",
            "default": false
          },
          "datasetId": {
            "title": "Dataset ID (read URLs from another run)",
            "type": "string",
            "description": "ID of an Apify dataset, e.g. the output of a scraper run. Image/PDF URLs are read from the field named in urlField. Files are detected by content: PDFs give one row per page (like documentUrls), images one row each.",
            "default": ""
          },
          "urlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Field of each dataset item that holds the image URL (a string or a list of strings). Dotted paths such as media.src are supported.",
            "default": "url"
          },
          "language": {
            "title": "OCR Language",
            "type": "string",
            "description": "Tesseract language code. Leave empty for auto-detection. Pick one of 126 tessdata_fast languages or type a '+' combination such as 'eng+ara'. eng, chi_sim, jpn, kor, deu, fra and spa are built in; any other pack is downloaded once per run (an unknown code or a failed download gives one free error row and the run continues).",
            "default": ""
          },
          "ocrEngine": {
            "title": "OCR engine",
            "enum": [
              "tesseract",
              "rapidocr"
            ],
            "type": "string",
            "description": "'tesseract' (default) = the classic engine, output unchanged. 'rapidocr' = RapidOCR, a deep-learning engine (PaddleOCR PP-OCR models on CPU) that reads photos, screenshots, skewed scans, Chinese, Japanese and Korean better. rapidocr covers English, Chinese (chi_sim, chi_tra), Japanese, Korean and about 45 Latin-script languages; for any other language the row is read with Tesseract and carries an ocr_engine_warning. With rapidocr each row adds ocr_engine and ocr_engine_warning. Same price. Also available in REST API (Standby) mode as ?ocrEngine=.",
            "default": "tesseract"
          },
          "translateTo": {
            "title": "Translate text to (optional)",
            "enum": [
              "bg",
              "bn",
              "ca",
              "cs",
              "da",
              "el",
              "en",
              "fi",
              "fr",
              "hu",
              "id",
              "lt",
              "lv",
              "ms",
              "nb",
              "nl",
              "pb",
              "pl",
              "pt",
              "ro",
              "sk",
              "sl",
              "sq",
              "th",
              "tl",
              "ur",
              "vi",
              "zh",
              "zt"
            ],
            "type": "string",
            "description": "Also translate the OCR text into this language, offline. Each OK row then adds translated_text, translation_language, translation_source_language and translation_warning; `text` stays as read. The OCR language is the source; source and target go through English when there is no direct model. Models: OPUS-MT (CC-BY 4.0) packaged by Argos Translate, run on CPU with no external translation API. Each model is downloaded once per run on first use (about 60-300 MB). Sources: bg, bn, ca, cs, da, el, en, es, fi, fr, hu, id, lt, lv, ms, nb, nl, pb, pl, pt, ro, sk, sl, sq, th, tl, uk, ur, vi, zh, zt. If a pair is unsupported or a model fails to load, the row is still delivered with its original text: translated_text is null and translation_warning says why. Same price. Leave empty for no translation. REST API (Standby): ?translateTo=."
          },
          "preprocessing": {
            "title": "Image preprocessing",
            "enum": [
              "none",
              "grayscale",
              "threshold",
              "deskew"
            ],
            "type": "string",
            "description": "Apply image preprocessing before OCR. 'none' = raw image. 'grayscale' = convert to grayscale (often improves accuracy). 'threshold' = binary black/white (best for documents with clear text on white background). 'deskew' = auto-rotate skewed scans.",
            "default": "grayscale"
          },
          "pageSegMode": {
            "title": "Page segmentation mode (PSM)",
            "minimum": 0,
            "maximum": 13,
            "type": "integer",
            "description": "Tesseract PSM. 3 = auto (default), 6 = single block of text, 7 = single line, 8 = single word, 11 = sparse text (scattered text). See Tesseract docs.",
            "default": 3
          },
          "minConfidence": {
            "title": "Minimum word confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Filter out words with OCR confidence below this threshold (0-100). Default 0 = include all words. Higher values (e.g. 60) reduce noise but may drop valid words.",
            "default": 0
          },
          "limit": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of images or PDFs to process (1-200).",
            "default": 50
          },
          "maxImageSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Files larger than this are skipped with error file_too_large and not charged. Checked against Content-Length and while downloading.",
            "default": 20
          },
          "retries": {
            "title": "Download retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries per URL on server errors (5xx, 408, 429) and timeouts. Client errors such as 404 are not retried.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum time for each download attempt. A file that times out on every attempt gives an uncharged request_timeout error row and the run continues.",
            "default": 30
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "text",
              "json",
              "lines"
            ],
            "type": "string",
            "description": "'text' (default) = plain text string. 'json' = structured object with word_count, confidence_score, tables, pages etc. 'lines' = array of non-empty lines from the OCR result.",
            "default": "text"
          },
          "layout": {
            "title": "Layout (word bounding boxes)",
            "type": "boolean",
            "description": "Add the page layout to each result: blocks > paragraphs > lines > words, each with text, a pixel bounding box {x, y, w, h} and confidence, plus image_width/image_height. Built from the same OCR pass, so it costs nothing extra. Off by default (output unchanged).",
            "default": false
          },
          "outputDetail": {
            "title": "Output detail (paragraphs and lines)",
            "enum": [
              "text",
              "lines",
              "paragraphs",
              "full"
            ],
            "type": "string",
            "description": "Text structure to add to each result. 'text' (default) = plain text only, output unchanged. 'lines' = a `lines` array, each line with text, pixel bbox {x, y, w, h}, confidence and its words. 'paragraphs' = a `paragraphs` array with text, bbox and confidence. 'full' = the whole blocks > paragraphs > lines > words tree (same as layout). All from the same OCR pass, no extra charge. Also available in REST API (Standby) mode as ?outputDetail=.",
            "default": "text"
          },
          "includeMarkdown": {
            "title": "Include markdown",
            "type": "boolean",
            "description": "Add a markdown field: the text as markdown paragraphs, one per paragraph Tesseract found (or per blank-line block for text-layer PDF pages). Off by default (output unchanged).",
            "default": false
          },
          "changeDetection": {
            "title": "Change detection",
            "type": "boolean",
            "description": "Compare OCR text hash against previous run (stored in named KVS 'image-ocr-change-detection'). Each result will include a 'changed' field: true = text changed since last run, false = unchanged, null = no previous data.",
            "default": false
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Telegram bot token (format: 123456:ABC-...). Used to send alerts when changeDetection=true and at least one image has changed. Leave empty to disable Telegram alerts.",
            "default": ""
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Telegram chat ID (user, group, or channel) to receive change alerts. Required when telegramBotToken is set.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}