{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR: Extract Text from Images, Bulk OCR API",
    "description": "Extract text from images in bulk with Tesseract OCR: image URLs (PNG, JPEG, WebP, TIFF, GIF, BMP or one-page scanned PDFs) in, text out, with a confidence score, image size and optional line and word boxes. 32 languages incl. Chinese, Japanese and Arabic. Pay per image.",
    "version": "1.1",
    "x-build-id": "T5rL60UC8ruOZ4IhM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/humble-echidna~image-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-humble-echidna-image-ocr",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/humble-echidna~image-ocr/runs": {
      "post": {
        "operationId": "runs-sync-humble-echidna-image-ocr",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/humble-echidna~image-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-humble-echidna-image-ocr",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to the images, one per line: PNG, JPEG, WebP, TIFF, GIF or BMP files, or one-page PDFs (scans), on public web addresses (http/https, ports 80 and 443). The format is read from the file itself, so links without an extension work too. Links to an image viewer or a login page don't: use the link to the file. The default is two small public-domain scans on Wikimedia Commons. Ignored when datasetId is set.",
            "default": [
              "https://upload.wikimedia.org/wikipedia/commons/d/d7/The_Quick_Brown_Fox_Newspaper_Reference.png",
              "https://upload.wikimedia.org/wikipedia/commons/2/24/Scan_of_%22Proceedings_of_the_Cambridge_Philosophical_Society_19_%281917-1920%29%22_%28English%2C_page_36%29.png"
            ],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or: image links from a dataset",
            "type": "string",
            "description": "One of your Apify datasets, picked here or given by id, e.g. Bulk Image Downloader's or a shop or Instagram scraper's results: each item's image link is read like a line of urls (urls is ignored). Empty by default. Items without a link or with a value that isn't a web address are skipped; duplicates are read once. Each result carries sourceTitle and sourceIndex from its item. At most the first 20,000 items and 10,000 links are read, with your own account's access, read-only."
          },
          "datasetUrlField": {
            "title": "Field with the image link (dataset)",
            "type": "string",
            "description": "Only with datasetId: the item field that holds the image link, e.g. `imageUrl`, or a dotted path such as `product.image`. Leave empty (the default) to find it automatically: the first of imageUrl, image, displayUrl, images, src and url that has a link in the first 100 items, then the same names one level down. If the field holds a list of links, only the first is used."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The language(s) of the text, as Tesseract codes, at most 4, e.g. [\"eng\", \"deu\"] for bilingual English and German labels. Default [\"eng\"] (English). Pick every language that appears in your images; each extra language makes recognition slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "slk",
                "swe",
                "dan",
                "nor",
                "fin",
                "hun",
                "ron",
                "tur",
                "ell",
                "rus",
                "ukr",
                "bul",
                "ara",
                "heb",
                "hin",
                "ben",
                "tha",
                "vie",
                "ind",
                "jpn",
                "chi_sim",
                "chi_tra",
                "kor"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Slovak",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Hungarian",
                "Romanian",
                "Turkish",
                "Greek",
                "Russian",
                "Ukrainian",
                "Bulgarian",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Bengali",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Japanese",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Korean"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageSegmentation": {
            "title": "Layout",
            "enum": [
              "auto",
              "autoWithOrientation",
              "singleBlock",
              "singleLine",
              "sparse"
            ],
            "type": "string",
            "description": "How the text is laid out. `auto` (the default): documents, pages, columns; suits most scans and photos of pages. `autoWithOrientation`: the same, and detects sideways or upside-down text. `singleBlock`: one block (a paragraph, a receipt). `singleLine`: one line (a label, a caption). `sparse`: scattered text (screenshots, signs, diagrams, forms). If a result misses text, try `sparse` or `singleBlock`.",
            "default": "auto"
          },
          "includeLines": {
            "title": "Include lines with positions",
            "type": "boolean",
            "description": "Default false. When true, add a `lines` list: each line's text, confidence and bounding box in pixels (left, top, width, height). The `text` field already has every line.",
            "default": false
          },
          "includeWords": {
            "title": "Include words with positions",
            "type": "boolean",
            "description": "Default false. When true, add a `words` list: each word's text, confidence and bounding box in pixels. Useful for highlighting, redaction or form fields; makes each result larger.",
            "default": false
          },
          "maxResults": {
            "title": "Max images per run",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many images read in total, e.g. 20. Minimum 1; leave empty (the default) for no limit. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first. Set it to keep a run small and quick."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}