{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR: Images & Scanned PDFs, 24 Languages",
    "description": "Extract text from image URLs (PNG, JPG, WebP, TIFF, GIF) and scanned PDFs with open-source Tesseract OCR. 24 languages incl. Korean, Japanese, Chinese. Confidence, word boxes, dataset input. Blank pages and failed files are free.",
    "version": "0.1",
    "x-build-id": "UTYgvpXi5UCY4zrDT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ctriolab~image-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ctriolab-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/ctriolab~image-ocr/runs": {
      "post": {
        "operationId": "runs-sync-ctriolab-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/ctriolab~image-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-ctriolab-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": "Direct links to images (PNG, JPG, WebP, TIFF, GIF, BMP) or scanned PDFs. The URL must return the file itself, not a web page. Leave empty to read a built-in public domain sample page.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Language(s) of the text. Pick more than one for mixed documents (slower). Default English.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "kor",
                "jpn",
                "chi_sim",
                "chi_tra",
                "spa",
                "deu",
                "fra",
                "por",
                "ita",
                "nld",
                "pol",
                "rus",
                "ukr",
                "tur",
                "ara",
                "hin",
                "vie",
                "ind",
                "tha",
                "swe",
                "ces",
                "ell",
                "heb"
              ],
              "enumTitles": [
                "English",
                "Korean",
                "Japanese",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Spanish",
                "German",
                "French",
                "Portuguese",
                "Italian",
                "Dutch",
                "Polish",
                "Russian",
                "Ukrainian",
                "Turkish",
                "Arabic",
                "Hindi",
                "Vietnamese",
                "Indonesian",
                "Thai",
                "Swedish",
                "Czech",
                "Greek",
                "Hebrew"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "keyValueStore": {
            "title": "Or files in an Apify key-value store",
            "type": "string",
            "description": "A key-value store in your account that holds images or PDFs. Pick it here and list the record keys below."
          },
          "keyValueStoreKeys": {
            "title": "Record keys in that store",
            "type": "array",
            "description": "Keys of the image or PDF records, for example receipt-01.jpg.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or read URLs from a dataset",
            "type": "string",
            "description": "An Apify dataset (for example from a scraper run) with image or PDF links. Every column of the source row is kept in the result row. In an integration after another Actor use {{resource.defaultDatasetId}}."
          },
          "urlField": {
            "title": "URL field in that dataset",
            "type": "string",
            "description": "Field that holds the link in each dataset item. Dotted paths work, for example images.0.url.",
            "default": "url"
          },
          "layout": {
            "title": "Page layout",
            "enum": [
              "auto",
              "block",
              "column",
              "sparse",
              "line"
            ],
            "type": "string",
            "description": "Tells Tesseract how the text is laid out. Try Sparse for receipts and photos with scattered text.",
            "default": "auto"
          },
          "grayscale": {
            "title": "Convert to grayscale",
            "type": "boolean",
            "description": "Usually improves results on colored backgrounds.",
            "default": true
          },
          "upscale": {
            "title": "Upscale small images",
            "enum": [
              "auto",
              "2x",
              "none"
            ],
            "type": "string",
            "description": "Small text is read much better at a larger size. Word boxes are always given in original image pixels.",
            "default": "auto"
          },
          "deskew": {
            "title": "Straighten tilted scans (deskew)",
            "type": "boolean",
            "description": "Detects a tilt of up to 10 degrees and rotates the page straight before OCR. Word boxes then refer to the straightened page.",
            "default": false
          },
          "includePages": {
            "title": "Include per-page results",
            "type": "boolean",
            "description": "Add a pages list with the text, confidence and word count of each page.",
            "default": true
          },
          "includeWords": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add every word with its confidence (0 to 100) and bounding box (left, top, width, height) to each page. Makes rows much larger.",
            "default": false
          },
          "pages": {
            "title": "Pages of PDFs and TIFFs",
            "type": "string",
            "description": "Optional page selection, for example 1-3, 7, 10- (10 to the end). Empty: all pages up to the limit below."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages after this are not read and not charged.",
            "default": 50
          },
          "pdfDpi": {
            "title": "PDF render resolution (DPI)",
            "minimum": 72,
            "maximum": 600,
            "type": "integer",
            "description": "300 suits most scans. Use 400 for tiny print. Higher is slower.",
            "default": 300
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Only for password protected PDFs."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped and not charged.",
            "default": 50
          },
          "onlyNew": {
            "title": "Only new files",
            "type": "boolean",
            "description": "Skip URLs this Actor already read in an earlier run with the same monitor name. Useful for scheduled runs over a growing list.",
            "default": false
          },
          "stateName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the key-value store that remembers read URLs when Only new files is on. Use a different name per list.",
            "default": "ctriolab-image-ocr-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}