{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR - Extract Text from Images & Screenshots",
    "description": "Bulk OCR for image URLs or a dataset: get text plus lines and words with confidence and bounding boxes. Receipts, menus, labels, screenshots, scans. 100+ languages, only-new mode for schedules. Pay only for images with text; blank and failed images are free.",
    "version": "0.1",
    "x-build-id": "ZCGRc2RYPEzJ2vhOA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rjmacarthy~image-ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rjmacarthy-image-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/rjmacarthy~image-ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-rjmacarthy-image-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/rjmacarthy~image-ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-rjmacarthy-image-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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to image files, one per line (JPG, PNG, WebP, GIF first frame, BMP, TIFF first page, AVIF). The image must be public (no login). Apify key-value store record URLs work too. Required unless you set a Dataset ID below. PDFs are not supported: use our PDF to Markdown Actor.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Read image URLs from an Apify dataset, e.g. the output of a product or social media scraper. Give the dataset ID or name; set the field that holds the image link below. Combined with Image URLs."
          },
          "urlField": {
            "title": "URL field in dataset",
            "type": "string",
            "description": "Field of each dataset item holding the image URL. Dotted paths work (e.g. product.image). The field may also be an array of URLs or of objects with a url field, e.g. images.",
            "default": "url"
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Tesseract language codes of the text in the images, e.g. eng, deu, fra, spa, por, ita, nld, pol, tur, rus, ara, hin, jpn, chi_sim, chi_tra, kor (2-letter codes like de or fr are accepted too). English is built in; other languages are downloaded once per run (2-15 MB each). Combine languages only when images really mix them: each extra language slows OCR.",
            "default": [
              "eng"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output detail",
            "enum": [
              "text",
              "text+lines",
              "text+words"
            ],
            "type": "string",
            "description": "Text only is smallest. Lines and words include a confidence (0-100) and a bounding box {x0, y0, x1, y1} in the original image's pixels.",
            "default": "text+lines"
          },
          "preprocess": {
            "title": "Preprocess images",
            "type": "boolean",
            "description": "Rotate photos upright from their EXIF orientation and upscale small images (under 1000 px) 2x, which improves accuracy on small text. Huge images (over 4000 px) are always scaled down.",
            "default": true
          },
          "pageSegMode": {
            "title": "Page layout",
            "enum": [
              "auto",
              "single-block",
              "sparse-text"
            ],
            "type": "string",
            "description": "How Tesseract looks for text. Auto suits most documents and screenshots; try Sparse text for photos and ad creatives, Single block for receipts and labels.",
            "default": "auto"
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of images to process in this run (0 = no limit).",
            "default": 50
          },
          "maxImageMb": {
            "title": "Max image size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped with an error item (not charged).",
            "default": 15
          },
          "concurrency": {
            "title": "Parallel workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "OCR workers running in parallel. OCR is CPU-bound and Apify gives 1 CPU core per 4 GB of memory, so more workers only help with more memory: the Actor uses at most one worker per 2 GB of run memory.",
            "default": 2
          },
          "onlyNew": {
            "title": "Only new images",
            "type": "boolean",
            "description": "Skip images already processed by an earlier run of this Actor in your account (same URL and same file content). Ideal for scheduled runs over a folder or a growing dataset. Skipped images are not output or charged; an image replaced at the same URL is processed again.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for most images. Enable Apify Proxy (datacenter) if a site blocks downloads from Apify's servers (HTTP 403/429), or add your own proxy URLs. Residential and SERP proxy groups are not supported: the run falls back to Apify datacenter proxy.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}