{
  "openapi": "3.0.1",
  "info": {
    "title": "Image OCR: Image to Text, Arabic and 120 Languages",
    "description": "OCR for images: extract text from photos, screenshots and scanned pages with Tesseract. Bulk input from URLs or another Actor's dataset. Returns text, confidence, lines and optional word boxes or hOCR. Arabic right-to-left, English and 120 more languages. No outside OCR API.",
    "version": "0.1",
    "x-build-id": "8NVmUELD6AOIFHPC9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maliksaid~image-ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maliksaid-image-ocr-text-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/maliksaid~image-ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-maliksaid-image-ocr-text-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/maliksaid~image-ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-maliksaid-image-ocr-text-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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Links to the images to read, one per line. PNG, JPEG, WebP, BMP, GIF, TIFF and PNM work. The Actor reads robots.txt on each host and skips images it does not allow. Leave empty to read only the key-value store below.",
            "items": {
              "type": "string"
            }
          },
          "imageListUrl": {
            "title": "Image list file (CSV or TXT URL)",
            "type": "string",
            "description": "Optional. A link to a CSV or text file with image links, for example a Google Sheets CSV export link (File > Share > Publish to web > CSV). Every cell that starts with http is read as one image. Reading stops at Maximum results."
          },
          "keyValueStoreId": {
            "title": "Key-value store with image files",
            "type": "string",
            "description": "Optional. Pick one of your key-value stores that holds uploaded image files. The Actor only reads this store."
          },
          "keyValueStoreKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Optional. Read only these records of the store. Leave empty to read every image record in the store.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with image links",
            "type": "string",
            "description": "Optional. Pick a dataset, for example the output of another scraper. The Actor reads the image link from each row. It only reads the dataset."
          },
          "datasetUrlField": {
            "title": "Link field in the dataset",
            "type": "string",
            "description": "The field that holds the image link, for example imageUrl. Empty: the Actor uses the first of url, imageUrl, image, src, displayUrl, thumbnailUrl that holds a link. Arrays of links give one image each.",
            "default": ""
          },
          "keepSourceFields": {
            "title": "Keep the source row",
            "type": "boolean",
            "description": "Copy the dataset row or list file row each image came from into the sourceItem field (up to 10 KB), so the text lines up with your own columns, such as a SKU.",
            "default": false
          },
          "imagesBase64": {
            "title": "Images as base64",
            "type": "array",
            "description": "Optional. Images as base64 text or data URLs (data:image/png;base64,...). Use this when the image has no public link, for example from an API or an AI agent. Up to 8 MB of base64 text per run; entries after that get a free failed row. For larger batches, upload the images to a key-value store and pick it above.",
            "default": []
          },
          "maxPdfPages": {
            "title": "Maximum PDF pages",
            "minimum": 0,
            "type": "integer",
            "description": "PDF files are read page by page, one row per page. Each page is charged like one image. 0 reads every page.",
            "default": 10
          },
          "pdfDpi": {
            "title": "PDF render DPI",
            "minimum": 72,
            "maximum": 300,
            "type": "integer",
            "description": "Resolution for scanned PDF pages. Higher reads small text better but takes longer.",
            "default": 150
          },
          "usePdfTextLayer": {
            "title": "Use the PDF's own text when it has one",
            "type": "boolean",
            "description": "A digital PDF page with real text is copied as is, which is exact and fast. Turn off to OCR every page.",
            "default": true
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Languages in the images. Pick every language that appears, for example English and Arabic for bilingual documents. Each extra language makes OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "ara",
                "afr",
                "amh",
                "asm",
                "aze",
                "aze_cyrl",
                "bel",
                "ben",
                "bod",
                "bos",
                "bre",
                "bul",
                "cat",
                "ceb",
                "ces",
                "chi_sim",
                "chi_sim_vert",
                "chi_tra",
                "chi_tra_vert",
                "chr",
                "cos",
                "cym",
                "dan",
                "deu",
                "deu_latf",
                "div",
                "dzo",
                "ell",
                "enm",
                "epo",
                "est",
                "eus",
                "fao",
                "fas",
                "fil",
                "fin",
                "fra",
                "frm",
                "fry",
                "gla",
                "gle",
                "glg",
                "grc",
                "guj",
                "hat",
                "heb",
                "hin",
                "hrv",
                "hun",
                "hye",
                "iku",
                "ind",
                "isl",
                "ita",
                "ita_old",
                "jav",
                "jpn",
                "jpn_vert",
                "kan",
                "kat",
                "kat_old",
                "kaz",
                "khm",
                "kir",
                "kmr",
                "kor",
                "kor_vert",
                "lao",
                "lat",
                "lav",
                "lit",
                "ltz",
                "mal",
                "mar",
                "mkd",
                "mlt",
                "mon",
                "mri",
                "msa",
                "mya",
                "nep",
                "nld",
                "nor",
                "oci",
                "ori",
                "pan",
                "pol",
                "por",
                "pus",
                "que",
                "ron",
                "rus",
                "san",
                "sin",
                "slk",
                "slv",
                "snd",
                "spa",
                "spa_old",
                "sqi",
                "srp",
                "srp_latn",
                "sun",
                "swa",
                "swe",
                "syr",
                "tam",
                "tat",
                "tel",
                "tgk",
                "tha",
                "tir",
                "ton",
                "tur",
                "uig",
                "ukr",
                "urd",
                "uzb",
                "uzb_cyrl",
                "vie",
                "yid",
                "yor"
              ],
              "enumTitles": [
                "English (eng)",
                "Arabic (ara)",
                "Afrikaans (afr)",
                "Amharic (amh)",
                "Assamese (asm)",
                "Azerbaijani (aze)",
                "Azerbaijani (Cyrillic) (aze_cyrl)",
                "Belarusian (bel)",
                "Bengali (ben)",
                "Tibetan (bod)",
                "Bosnian (bos)",
                "Breton (bre)",
                "Bulgarian (bul)",
                "Catalan (cat)",
                "Cebuano (ceb)",
                "Czech (ces)",
                "Chinese (Simplified) (chi_sim)",
                "Chinese (Simplified, vertical) (chi_sim_vert)",
                "Chinese (Traditional) (chi_tra)",
                "Chinese (Traditional, vertical) (chi_tra_vert)",
                "Cherokee (chr)",
                "Corsican (cos)",
                "Welsh (cym)",
                "Danish (dan)",
                "German (deu)",
                "German (Fraktur) (deu_latf)",
                "Dhivehi (div)",
                "Dzongkha (dzo)",
                "Greek (ell)",
                "Middle English (enm)",
                "Esperanto (epo)",
                "Estonian (est)",
                "Basque (eus)",
                "Faroese (fao)",
                "Persian (fas)",
                "Filipino (fil)",
                "Finnish (fin)",
                "French (fra)",
                "Middle French (frm)",
                "Western Frisian (fry)",
                "Scottish Gaelic (gla)",
                "Irish (gle)",
                "Galician (glg)",
                "Ancient Greek (grc)",
                "Gujarati (guj)",
                "Haitian Creole (hat)",
                "Hebrew (heb)",
                "Hindi (hin)",
                "Croatian (hrv)",
                "Hungarian (hun)",
                "Armenian (hye)",
                "Inuktitut (iku)",
                "Indonesian (ind)",
                "Icelandic (isl)",
                "Italian (ita)",
                "Italian (old) (ita_old)",
                "Javanese (jav)",
                "Japanese (jpn)",
                "Japanese (vertical) (jpn_vert)",
                "Kannada (kan)",
                "Georgian (kat)",
                "Georgian (old) (kat_old)",
                "Kazakh (kaz)",
                "Khmer (khm)",
                "Kyrgyz (kir)",
                "Kurmanji Kurdish (kmr)",
                "Korean (kor)",
                "Korean (vertical) (kor_vert)",
                "Lao (lao)",
                "Latin (lat)",
                "Latvian (lav)",
                "Lithuanian (lit)",
                "Luxembourgish (ltz)",
                "Malayalam (mal)",
                "Marathi (mar)",
                "Macedonian (mkd)",
                "Maltese (mlt)",
                "Mongolian (mon)",
                "Maori (mri)",
                "Malay (msa)",
                "Burmese (mya)",
                "Nepali (nep)",
                "Dutch (nld)",
                "Norwegian (nor)",
                "Occitan (oci)",
                "Odia (ori)",
                "Punjabi (pan)",
                "Polish (pol)",
                "Portuguese (por)",
                "Pashto (pus)",
                "Quechua (que)",
                "Romanian (ron)",
                "Russian (rus)",
                "Sanskrit (san)",
                "Sinhala (sin)",
                "Slovak (slk)",
                "Slovenian (slv)",
                "Sindhi (snd)",
                "Spanish (spa)",
                "Spanish (old) (spa_old)",
                "Albanian (sqi)",
                "Serbian (Cyrillic) (srp)",
                "Serbian (Latin) (srp_latn)",
                "Sundanese (sun)",
                "Swahili (swa)",
                "Swedish (swe)",
                "Syriac (syr)",
                "Tamil (tam)",
                "Tatar (tat)",
                "Telugu (tel)",
                "Tajik (tgk)",
                "Thai (tha)",
                "Tigrinya (tir)",
                "Tongan (ton)",
                "Turkish (tur)",
                "Uyghur (uig)",
                "Ukrainian (ukr)",
                "Urdu (urd)",
                "Uzbek (uzb)",
                "Uzbek (Cyrillic) (uzb_cyrl)",
                "Vietnamese (vie)",
                "Yiddish (yid)",
                "Yoruba (yor)"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "model": {
            "title": "Model",
            "enum": [
              "fast",
              "best"
            ],
            "type": "string",
            "description": "Fast uses the tessdata_fast models. Accurate uses the standard tessdata models, made from tessdata_best. They are a little more accurate and about 1.6 times slower.",
            "default": "fast"
          },
          "pageSegmentation": {
            "title": "Page layout",
            "enum": [
              "auto",
              "singleColumn",
              "singleBlock",
              "singleLine",
              "singleWord",
              "sparseText"
            ],
            "type": "string",
            "description": "How Tesseract splits the image into text areas. Automatic suits most pages. Sparse text finds scattered words in photos and screenshots.",
            "default": "auto"
          },
          "preserveSpacing": {
            "title": "Keep spaces between words",
            "type": "boolean",
            "description": "Keep runs of spaces in the text. This keeps table-like layouts aligned in each line.",
            "default": false
          },
          "preprocess": {
            "title": "Clean images before OCR",
            "enum": [
              "none",
              "auto",
              "grayscale",
              "threshold"
            ],
            "type": "string",
            "description": "Clean the image before OCR. Auto puts transparent images on a plain background, turns them grey and enlarges small text. Black and white also removes light noise. Off by default.",
            "default": "none"
          },
          "minWordConfidence": {
            "title": "Minimum word confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop words below this confidence (0 to 100) from text, lines, words and paragraphs. 0 keeps every word. The confidence field still reports the mean of all words.",
            "default": 0
          },
          "includeLines": {
            "title": "Include lines",
            "type": "boolean",
            "description": "Add each text line with its confidence, reading direction and bounding box.",
            "default": true
          },
          "includeWords": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add each word with its confidence and bounding box in pixels. This makes rows much larger.",
            "default": false
          },
          "includeHocr": {
            "title": "Include hOCR",
            "type": "boolean",
            "description": "Add the hOCR (HTML with layout and boxes) for each image.",
            "default": false
          },
          "includeParagraphs": {
            "title": "Include paragraphs",
            "type": "boolean",
            "description": "Add each paragraph with its text, confidence, reading direction and bounding box.",
            "default": false
          },
          "includeMarkdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Add a markdown field: paragraphs in reading order, one blank line apart. PDF pages start with a ## Page N heading. Useful for AI and search.",
            "default": false
          },
          "maxImageMegabytes": {
            "title": "Maximum image size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip images larger than this. Big photos need more memory.",
            "default": 20
          },
          "maxItems": {
            "title": "Maximum images",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many images are read. Set 0 for no limit.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}