{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR Text Extractor",
    "description": "Read text off images and scanned PDFs with OCR in 19 languages. Every page returns its recognised text and an engine confidence score, plus optional word positions for building document parsers. Export data, run via API, schedule runs, or integrate with other tools or AI workflows.",
    "version": "0.1",
    "x-build-id": "5R4qrsxTcp6DBukAJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-ocr-text-extractor",
        "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/lergassy~ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-ocr-text-extractor",
        "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/lergassy~ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-ocr-text-extractor",
        "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 or PDF URLs",
            "type": "array",
            "description": "Direct links to the files you want to read: PNG, JPG, WEBP, TIFF, BMP, GIF, HEIC or PDF. Scanned PDFs are rendered page by page and read with OCR.",
            "items": {
              "type": "string"
            }
          },
          "file": {
            "title": "📎 Upload a file",
            "type": "string",
            "description": "Upload one image or PDF from your computer instead of giving a URL."
          },
          "base64Files": {
            "title": "🧬 Base64 files (for API calls)",
            "type": "array",
            "description": "Base64-encoded images or PDFs for API and agent calls. Each entry is a plain base64 string (a data-URI prefix is allowed) or an object <code>{\"fileName\": \"scan.png\", \"data\": \"…\"}</code>."
          },
          "language": {
            "title": "🔤 OCR language",
            "enum": [
              "eng",
              "deu",
              "fra",
              "spa",
              "por",
              "ita",
              "nld",
              "pol",
              "rus",
              "ukr",
              "tur",
              "ind",
              "vie",
              "ara",
              "hin",
              "chi_sim",
              "chi_tra",
              "jpn",
              "kor"
            ],
            "type": "string",
            "description": "Language of the text in the scan. Picking the right one is the single biggest factor in accuracy.",
            "default": "eng"
          },
          "autoDetectLanguage": {
            "title": "Detect the script automatically",
            "type": "boolean",
            "description": "Look at the page first and switch language when the script is clearly Cyrillic, Arabic, Chinese, Japanese, Korean or Devanagari. Adds a moment per file.",
            "default": false
          },
          "includePages": {
            "title": "Per-page output",
            "type": "boolean",
            "description": "Return each page separately with its own text and confidence score, alongside the full text.",
            "default": true
          },
          "includeWordBoxes": {
            "title": "Word positions and confidence",
            "type": "boolean",
            "description": "Return every recognised word with its confidence and its box on the page. Use it to highlight text or to build a document parser.",
            "default": false
          },
          "minWordConfidence": {
            "title": "Minimum word confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop words the engine is less sure about than this, from 0 to 100. Raise it to cut noise out of poor scans.",
            "default": 0
          },
          "useExistingTextLayer": {
            "title": "Reuse a PDF's own text layer",
            "type": "boolean",
            "description": "When a PDF page already contains text, copy it instead of running OCR. Faster, cheaper and more accurate. Switch off to force OCR everywhere.",
            "default": true
          },
          "pageRange": {
            "title": "📑 Page range",
            "type": "string",
            "description": "Read only these PDF pages, for example <code>1-5</code>, <code>8</code> or <code>12-</code> (page 12 to the end)."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap so a long scan cannot run up an unexpected bill.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "⚡ Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many files to read at the same time.",
            "default": 3
          },
          "maxFileSizeMb": {
            "title": "📦 Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Files larger than this are skipped with an error row instead of being downloaded.",
            "default": 50
          },
          "timeoutPerFileSecs": {
            "title": "⏱️ Download timeout (seconds)",
            "minimum": 10,
            "maximum": 900,
            "type": "integer",
            "description": "How long to wait for one file to download before giving up on it.",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}