{
  "openapi": "3.0.1",
  "info": {
    "title": "Image OCR – Extract Text from Images, Screenshots & Scans",
    "description": "Image OCR: extract text from image URLs, screenshots and scans in 58 languages, with line and word boxes. Pay only for images where text is found.",
    "version": "0.1",
    "x-build-id": "e34aXD2xN8jC4eWOb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/far003~image-ocr-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-far003-image-ocr-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/far003~image-ocr-text/runs": {
      "post": {
        "operationId": "runs-sync-far003-image-ocr-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/far003~image-ocr-text/run-sync": {
      "post": {
        "operationId": "run-sync-far003-image-ocr-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": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to the images (PNG, JPEG, WebP, TIFF, GIF, BMP), one per entry, up to 10,000 here. For more, put the links in a dataset and use \"Dataset ID\". The image is read from the link itself, so it must be public. The three samples are scanned English title pages (public domain), so you can press Start at once.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Read the image links from a dataset of your own Apify account (for example the output of a scraper). Pick it from the list or paste its ID. Rows are read after the typed list."
          },
          "urlField": {
            "title": "URL field in the dataset",
            "type": "string",
            "description": "Name of the field that holds the image link in each dataset row. A path with dots such as \"image.src\" works. Rows where it is missing or not a link give a free \"invalid\" row.",
            "default": "url"
          },
          "keepFields": {
            "title": "Dataset fields to keep",
            "type": "array",
            "description": "Names of dataset fields to copy into each result under \"source\" (for example \"id\" or \"product\"), so you can join the text back to your data without counting positions. Up to 20.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (optional)",
            "type": "string",
            "description": "Read the images stored as records in a key-value store of your own account (for example the screenshots another Actor saved). Every record that is an image is read; the others give a free \"not_image\" row. Read after the dataset."
          },
          "keyPrefix": {
            "title": "Only keys starting with",
            "type": "string",
            "description": "Read only the records whose key starts with this text (for example \"screenshot-\"). Empty reads all (INPUT, OUTPUT and SUMMARY are always skipped)."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The language(s) of the text in the images. Pick the one you expect; up to 4 together are read in one pass (for a document that mixes languages), but each extra language makes the reading slower and a little less sure. Images in different languages are better run separately. The reader works on the scripts of these languages, so an image in a language that is not picked comes out wrong.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "ita",
                "fra",
                "deu",
                "spa",
                "por",
                "nld",
                "afr",
                "sqi",
                "eus",
                "cat",
                "hrv",
                "ces",
                "dan",
                "est",
                "fin",
                "glg",
                "hun",
                "isl",
                "ind",
                "gle",
                "lat",
                "lav",
                "lit",
                "msa",
                "nor",
                "pol",
                "ron",
                "slk",
                "slv",
                "swe",
                "tur",
                "vie",
                "rus",
                "ukr",
                "bul",
                "bel",
                "mkd",
                "srp",
                "kaz",
                "ell",
                "heb",
                "ara",
                "fas",
                "urd",
                "hye",
                "kat",
                "hin",
                "ben",
                "guj",
                "kan",
                "tam",
                "tel",
                "tha",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor"
              ],
              "enumTitles": [
                "English (eng)",
                "Italian (ita)",
                "French (fra)",
                "German (deu)",
                "Spanish (spa)",
                "Portuguese (por)",
                "Dutch (nld)",
                "Afrikaans (afr)",
                "Albanian (sqi)",
                "Basque (eus)",
                "Catalan (cat)",
                "Croatian (hrv)",
                "Czech (ces)",
                "Danish (dan)",
                "Estonian (est)",
                "Finnish (fin)",
                "Galician (glg)",
                "Hungarian (hun)",
                "Icelandic (isl)",
                "Indonesian (ind)",
                "Irish (gle)",
                "Latin (lat)",
                "Latvian (lav)",
                "Lithuanian (lit)",
                "Malay (msa)",
                "Norwegian (nor)",
                "Polish (pol)",
                "Romanian (ron)",
                "Slovak (slk)",
                "Slovenian (slv)",
                "Swedish (swe)",
                "Turkish (tur)",
                "Vietnamese (vie)",
                "Russian (rus)",
                "Ukrainian (ukr)",
                "Bulgarian (bul)",
                "Belarusian (bel)",
                "Macedonian (mkd)",
                "Serbian (Cyrillic) (srp)",
                "Kazakh (kaz)",
                "Greek (ell)",
                "Hebrew (heb)",
                "Arabic (ara)",
                "Persian (fas)",
                "Urdu (urd)",
                "Armenian (hye)",
                "Georgian (kat)",
                "Hindi (hin)",
                "Bengali (ben)",
                "Gujarati (guj)",
                "Kannada (kan)",
                "Tamil (tam)",
                "Telugu (tel)",
                "Thai (tha)",
                "Chinese (Simplified) (chi_sim)",
                "Chinese (Traditional) (chi_tra)",
                "Japanese (jpn)",
                "Korean (kor)"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "outputLevel": {
            "title": "Output detail",
            "enum": [
              "text",
              "lines",
              "words"
            ],
            "type": "string",
            "description": "\"Text\" gives the text of each image. \"Lines\" adds every line with its confidence and its box in pixels. \"Words\" adds the same for every word inside each line.",
            "default": "text"
          },
          "minWordConfidence": {
            "title": "Drop words below this confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Words the reader is less sure about than this (0-100) are left out of the text, the lines and the counts. 0 keeps everything. 60 removes most noise from a messy photo; it can also remove real words.",
            "default": 0
          },
          "layout": {
            "title": "Page layout",
            "enum": [
              "auto",
              "column",
              "block",
              "line",
              "sparse"
            ],
            "type": "string",
            "description": "How the text is laid out. \"Automatic\" suits pages and most screenshots. \"Single block\" suits one paragraph, \"single line\" one line (a number plate, a caption), \"sparse text\" scattered labels (a diagram, a UI screenshot, a photo of signs), \"single column\" text in one column of different sizes.",
            "default": "auto"
          },
          "grayscale": {
            "title": "Convert to grayscale",
            "type": "boolean",
            "description": "Remove colour before reading. It makes the file smaller and the reading a little faster; text on a coloured background is rarely read worse.",
            "default": true
          },
          "enhanceContrast": {
            "title": "Boost contrast",
            "type": "boolean",
            "description": "Stretch the brightness range of the image before reading. Helps with faded scans, photos taken in poor light and dark signs with light letters; it can make an already clean image slightly worse.",
            "default": false
          },
          "upscale": {
            "title": "Enlarge small text",
            "enum": [
              "auto",
              "off",
              "2",
              "3"
            ],
            "type": "string",
            "description": "\"Automatic\" reads the image as it is and, only when the reading is not sure (below 80) and the image is not already big, reads it once more enlarged twice and keeps the better of the two. \"Off\" never enlarges. \"2x\" and \"3x\" always enlarge (slower, and not always better: sharp text can come out worse).",
            "default": "auto"
          },
          "straighten": {
            "title": "Straighten tilted pages",
            "type": "boolean",
            "description": "Correct a page that is slightly tilted (a photographed document, a scan that is not square) before reading, up to about 15 degrees. The boxes then refer to the straightened image. It does not turn a page that is upside down or on its side: use \"Rotate\" for that.",
            "default": false
          },
          "rotate": {
            "title": "Rotate (degrees clockwise)",
            "enum": [
              "0",
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "Turn every image by 90, 180 or 270 degrees before reading, for scans that were fed sideways or upside down. The orientation stored in photos (EXIF) is always applied first.",
            "default": "0"
          },
          "dedupe": {
            "title": "Skip duplicates",
            "type": "boolean",
            "description": "An address that appears twice, or two addresses that give exactly the same image, are read once; the copies come back as free \"duplicate\" rows that point to the first. Turn off to read and charge every copy.",
            "default": true
          },
          "maxImages": {
            "title": "Maximum images",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many input entries. Leave empty for no limit. The run also stops, without error, when your spending limit is reached."
          },
          "maxFileMegabytes": {
            "title": "Largest file (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "A file bigger than this is not downloaded (or not read) and costs nothing. It is checked while the file arrives, so a huge file is cut short.",
            "default": 15
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Check the robots.txt of every site before fetching an image from it (and of every redirect target). A path that the site closes to bots gives a free \"blocked\" row. Turn off only for files you are allowed to fetch.",
            "default": true
          },
          "requestsPerSecond": {
            "title": "Requests per second per site",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "The most requests sent to one site per second. The Crawl-delay of robots.txt, if longer, wins.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Images read at the same time",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many images are downloaded and read in parallel; each one has its own OCR engine of about 150 MB. With the default memory (2048 MB) 3 is safe; with 4096 MB you can use 6-8.",
            "default": 3
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for a site to answer, and the longest silence allowed while a file arrives.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}