{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR: Images & Scanned PDFs to Text",
    "description": "OCR for images and scanned PDFs: per-page text, a confidence score and optional word boxes, in 27 languages (Tesseract). Give file URLs or a key-value store. Pages with no text and failed files are not charged.",
    "version": "0.1",
    "x-build-id": "o9a6pES7dSmjMYbc9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datagleaner~ocr-images-pdfs/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datagleaner-ocr-images-pdfs",
        "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/datagleaner~ocr-images-pdfs/runs": {
      "post": {
        "operationId": "runs-sync-datagleaner-ocr-images-pdfs",
        "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/datagleaner~ocr-images-pdfs/run-sync": {
      "post": {
        "operationId": "run-sync-datagleaner-ocr-images-pdfs",
        "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": "File URLs",
            "type": "array",
            "description": "Direct links to image or PDF files, one per line. Each must download without a login. The host's robots.txt is respected. Links on social networks and other sites whose terms forbid automated downloads are refused. Leave empty (with no key-value store) to read a built-in 3-page sample scan.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (your uploaded files)",
            "type": "string",
            "description": "Optional. A key-value store whose records are images or PDFs, for example files you uploaded in Apify Console (Storage > Key-value stores) or another run's store (`{{resource.defaultKeyValueStoreId}}` in an integration). Without keys below, every image or PDF record in the store is read and other records are skipped."
          },
          "keyValueStoreKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Optional. Only these record keys of the key-value store above.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The languages printed in the files, up to 5 (more makes OCR slower and less accurate). Pick every language a page mixes, e.g. English and German. Default: English.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "swe",
                "dan",
                "nor",
                "fin",
                "tur",
                "rus",
                "ukr",
                "ell",
                "ara",
                "heb",
                "hin",
                "tha",
                "vie",
                "ind",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Turkish",
                "Russian",
                "Ukrainian",
                "Greek",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "includeWordBoxes": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add a `words` array per page: each word with its confidence and pixel box (left, top, width, height) and its block, paragraph and line number, for highlighting, redaction or layout work.",
            "default": false
          },
          "pageSegmentationMode": {
            "title": "Page layout",
            "enum": [
              "auto",
              "single_column",
              "single_block",
              "single_line",
              "sparse"
            ],
            "type": "string",
            "description": "How the page is split into text before reading. Automatic suits most scans; try Sparse for screenshots and photos, One uniform block for receipts.",
            "default": "auto"
          },
          "pdfDpi": {
            "title": "PDF render resolution (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "PDF pages are rendered at this resolution before OCR. 300 is the standard; use 400 for small print, 200 for speed on large text.",
            "default": 300
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional, 1-based, applied to every file: for example 1-5, 8, 10-12 or 3- (page 3 to the end). Empty means all pages."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Only the first N selected pages of each file are read; pageCount still shows the full length.",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages in total",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Upper bound on pages read in this run, across all files: your cost cap.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Larger files are skipped with an error and not billed.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Files in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many files are downloaded and read at once. OCR is CPU-bound: more memory gives the run more CPU, so raise both together.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}