{
  "openapi": "3.0.1",
  "info": {
    "title": "Image & PDF to Text OCR: Tesseract for Screenshots, Receipts",
    "description": "Image to text and PDF to text OCR with Tesseract: extract text from images, screenshots, receipts, invoices and scanned PDFs in bulk, in 44 languages including Chinese, Japanese and Arabic. Plain text, word boxes, hOCR or TSV. Failed files are free.",
    "version": "0.1",
    "x-build-id": "z9cfhTbbUFXKk7GIg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/siteacs~image-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-siteacs-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/siteacs~image-ocr/runs": {
      "post": {
        "operationId": "runs-sync-siteacs-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/siteacs~image-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-siteacs-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": {
          "imageUrls": {
            "title": "Image or PDF URLs",
            "type": "array",
            "description": "Links to the images or PDFs to read, one per line: PNG, JPEG, WebP, GIF, BMP, TIFF (every page), HEIC/HEIF from phones, AVIF, or PDF. Each must be the file itself, not a web page that shows it. Duplicates are read once.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "Read images and PDFs saved in an Apify key-value store (yours, or one from another actor's run). With no keys below, every record is read except JSON and text records."
          },
          "keyValueStoreKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Only these records of the key-value store. Leave empty to read them all.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStorePrefix": {
            "title": "Record key prefix",
            "type": "string",
            "description": "Only the records whose key starts with this, for example \"receipt-\"."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "Read the image URLs found in a field of an Apify dataset, for example the output of a scraper run."
          },
          "datasetField": {
            "title": "Dataset field",
            "type": "string",
            "description": "The field that holds the image URL. Use dots for nested fields (\"images.url\"); a field with a list of URLs, or a list of objects with a \"url\", gives one file per URL.",
            "default": "imageUrl"
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The languages printed in the images. Pick every language that appears (up to 5); each extra one makes reading slower. Chinese, Japanese and Korean text comes out without spaces between characters.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "por",
                "spa",
                "deu",
                "fra",
                "ita",
                "nld",
                "cat",
                "glg",
                "eus",
                "pol",
                "ces",
                "slk",
                "slv",
                "hrv",
                "srp",
                "ron",
                "hun",
                "swe",
                "nor",
                "dan",
                "fin",
                "est",
                "lav",
                "lit",
                "tur",
                "ell",
                "rus",
                "ukr",
                "bul",
                "ara",
                "heb",
                "fas",
                "hin",
                "ben",
                "tha",
                "vie",
                "ind",
                "msa",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "lat"
              ],
              "enumTitles": [
                "English",
                "Portuguese",
                "Spanish",
                "German",
                "French",
                "Italian",
                "Dutch",
                "Catalan",
                "Galician",
                "Basque",
                "Polish",
                "Czech",
                "Slovak",
                "Slovenian",
                "Croatian",
                "Serbian (Cyrillic)",
                "Romanian",
                "Hungarian",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Estonian",
                "Latvian",
                "Lithuanian",
                "Turkish",
                "Greek",
                "Russian",
                "Ukrainian",
                "Bulgarian",
                "Arabic",
                "Hebrew",
                "Persian",
                "Hindi",
                "Bengali",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Malay",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean",
                "Latin"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageSegmentationMode": {
            "title": "Layout",
            "enum": [
              "auto",
              "single_column",
              "single_block",
              "sparse",
              "single_line",
              "single_word",
              "raw_line"
            ],
            "type": "string",
            "description": "How Tesseract splits the page. Automatic suits pages, scans and screenshots. For receipts, choose Single column: Automatic reads a column of prices after the item names instead of next to them.",
            "default": "auto"
          },
          "autoRotate": {
            "title": "Fix pages on their side or upside down",
            "type": "boolean",
            "description": "When a page reads badly, Tesseract's orientation check runs, and a page turned 90, 180 or 270 degrees is turned back and read again. Pages that read well cost nothing extra.",
            "default": true
          },
          "deskew": {
            "title": "Straighten tilted pages",
            "type": "boolean",
            "description": "Turns pages tilted by up to 15 degrees (a crooked scan or photo) so the lines run straight before reading.",
            "default": true
          },
          "upscale": {
            "title": "Enlarge small images",
            "enum": [
              "auto",
              "off",
              "2x",
              "3x"
            ],
            "type": "string",
            "description": "Tesseract reads letters best at 20-30 pixels high. Automatic doubles images whose longer side is at most 1,600 px (screenshots, thumbnails), which fixes most misread small text.",
            "default": "auto"
          },
          "enhanceContrast": {
            "title": "Stretch contrast",
            "type": "boolean",
            "description": "Stretch the gray levels so the darkest 1% becomes black and the lightest 1% white, for faded scans. Light text on a dark background is inverted in any case.",
            "default": false
          },
          "retryPoorPages": {
            "title": "Second try for pages that read badly",
            "type": "boolean",
            "description": "When a page reads nothing, or reads with a mean confidence under 60, it is read again from a smoothed copy (grain and JPEG noise on faint text) and the better result is kept.",
            "default": true
          },
          "threshold": {
            "title": "Black-and-white method",
            "enum": [
              "otsu",
              "sauvola",
              "adaptive"
            ],
            "type": "string",
            "description": "How Tesseract separates text from background. Otsu was the best on every kind of image in our tests; the others can help with uneven lighting.",
            "default": "otsu"
          },
          "characterWhitelist": {
            "title": "Only these characters",
            "type": "string",
            "description": "Limit the output to these characters, for example 0123456789.,- for meters and price tags. Leave empty for all."
          },
          "includeWords": {
            "title": "Words with boxes and confidence",
            "type": "boolean",
            "description": "Add every word with its confidence (0-100), its box (left, top, width, height in pixels of the image, after any rotation) and its block, paragraph and line number.",
            "default": false
          },
          "includeHocr": {
            "title": "hOCR",
            "type": "boolean",
            "description": "Add Tesseract's hOCR (HTML with word boxes) for searchable PDFs and layout tools. Its coordinates are those of the image as read (after enlarging and rotation).",
            "default": false
          },
          "includeTsv": {
            "title": "TSV",
            "type": "boolean",
            "description": "Add Tesseract's TSV table (one row per page, block, paragraph, line and word, with boxes and confidence); coordinates as for hOCR.",
            "default": false
          },
          "maxImages": {
            "title": "Maximum files",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many files (0 = no limit).",
            "default": 0
          },
          "maxPdfPages": {
            "title": "Pages per PDF or TIFF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF or multi-page TIFF, from the first. Each page read is one charged event; pages past the limit are not read, and the run's status says how many.",
            "default": 20
          },
          "pdfDpi": {
            "title": "PDF resolution",
            "minimum": 72,
            "maximum": 600,
            "type": "integer",
            "description": "Resolution PDF pages are rendered at before reading. 200 reads normal print well; use 300 for small print.",
            "default": 200
          },
          "pdfTextLayer": {
            "title": "PDF text layer",
            "enum": [
              "auto",
              "always-ocr"
            ],
            "type": "string",
            "description": "PDF pages that already hold real text (exported from Word, invoices from billing systems) are taken from the PDF itself (the text the page shows), with no OCR, and charged as a cheaper \"Text page\". Scanned pages, pages that are mostly a picture (even with a stamp or header as text) and text in a wrong code page are read by OCR. Choose Always OCR when the PDF's own text cannot be trusted, for example an old, poor OCR layer on a scan. Words with boxes, hOCR, TSV and \"Only these characters\" are OCR output: with any of them on, every page is read by OCR.",
            "default": "auto"
          },
          "maxFileMb": {
            "title": "Largest file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files over this size are skipped, free.",
            "default": 50
          },
          "maxMegapixels": {
            "title": "Largest image",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Images over this many pixels are skipped, free; so is a PDF page holding an embedded image this large. The size is read from the file header before the image is decoded. Pages larger than 5,000 pixels on their longer side are shrunk to 5,000 before reading (text stays readable; reading is faster). With little memory (under 1 GB) the run lowers this limit to what its memory holds.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}