{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text — OCR for Screenshots, Scans and Photos",
    "description": "[$0.004/image] Convert images to text with OCR: PNG, JPG, WEBP, TIFF, HEIC, screenshots, scans and scanned PDFs in 19 languages. Full text, confidence score and optional word boxes. No API key, no fee per run.",
    "version": "0.1",
    "x-build-id": "yxtNduF9BCyQr1i5b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~image-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-image-to-text",
        "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~image-to-text/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-image-to-text",
        "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~image-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-image-to-text",
        "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 you want to turn into text: PNG, JPG, WEBP, TIFF, BMP or GIF. Scanned PDFs work too — every page is read with OCR. The link must open the file itself, not a gallery or viewer page.",
            "default": [
              "https://raw.githubusercontent.com/lergassy/apify-actor-assets/main/document-text-extractor/sample-scan.png"
            ],
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}