{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR: Bulk Images to Text and Markdown",
    "description": "Extract text from images (PNG, JPEG, TIFF, WebP) with Tesseract OCR. Returns plain text, Markdown and lines with position and confidence. Images you provide only, nothing else is collected. Unreadable files and failed downloads are free.",
    "version": "0.2",
    "x-build-id": "eDoJrrj050AYlicpo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/greenrun~image-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-greenrun-image-to-text-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/greenrun~image-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-greenrun-image-to-text-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/greenrun~image-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-greenrun-image-to-text-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": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Public http or https links to images (PNG, JPEG, TIFF including multi-page, WebP, GIF, BMP), one per line. data:image/...;base64 URIs work too. Each image becomes one row; the index field keeps the input order.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Image URLs from a dataset (optional)",
            "type": "string",
            "description": "Also read the image links found in this dataset, for example the output of a scraper. Pick the field below."
          },
          "datasetField": {
            "title": "Dataset field with the links",
            "type": "string",
            "description": "Field of each dataset item that holds the image link. Dot paths and lists work: url, images, images.url, product.imageUrl.",
            "default": "url"
          },
          "languages": {
            "title": "Languages",
            "type": "string",
            "description": "Tesseract language codes joined with +, for example eng, eng+deu, chi_sim, jpn, ara, rus, ukr, hin. Installed: eng, pol, deu, fra, spa, ita, por, nld. The other 115 Tesseract languages are downloaded at the start of the run (a few seconds each).",
            "default": "eng"
          },
          "pageSegmentation": {
            "title": "Layout",
            "enum": [
              "auto",
              "sparse",
              "singleBlock",
              "singleColumn",
              "singleLine"
            ],
            "type": "string",
            "description": "How Tesseract looks for text. Auto suits documents and screenshots; Sparse text finds scattered words on photos, labels and signs; Single block, line or column for crops.",
            "default": "auto"
          },
          "includeLines": {
            "title": "Lines with position and confidence",
            "type": "boolean",
            "description": "Add every text line with its bounding box (in pixels of the original image) and confidence.",
            "default": true
          },
          "includeWords": {
            "title": "Words with position and confidence",
            "type": "boolean",
            "description": "Also add every word with its bounding box and confidence. Makes the output much larger.",
            "default": false
          },
          "maxImageSide": {
            "title": "Max image side for OCR (px)",
            "minimum": 500,
            "maximum": 4000,
            "type": "integer",
            "description": "Larger images are scaled down to this longer side before OCR (faster, cheaper, enough for normal text); images under 1000 px are scaled up 2x. At most 4000 (16 MP: two image events a page). Positions are always given in pixels of the original image.",
            "default": 2500
          },
          "maxPages": {
            "title": "Max pages per TIFF",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Multi-page TIFF files: OCR at most this many pages. Each page OCR'd is at least one 'image' event, charged when its OCR starts, with or without text.",
            "default": 20
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger images are skipped for free.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many images are downloaded at the same time. OCR itself uses one CPU core per 4 GB of memory.",
            "default": 4
          },
          "timeoutSecs": {
            "title": "Timeout per image (seconds)",
            "minimum": 10,
            "maximum": 1800,
            "type": "integer",
            "description": "Download and OCR of one image (each TIFF page) that take longer fail: free before the OCR starts; once it started, the events charged stay.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}