{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR Image to Text - Bulk Images, Screenshots & Scanned PDFs",
    "description": "Reads the printed text in images, screenshots and scanned PDFs (every page) in 31 languages: clean text, confidence, and optionally every word with its box.",
    "version": "0.1",
    "x-build-id": "ZyObRfqb5Pz28pNp8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/afterstar~image-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-afterstar-image-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/afterstar~image-ocr/runs": {
      "post": {
        "operationId": "runs-sync-afterstar-image-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/afterstar~image-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-afterstar-image-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 or PDF links",
            "type": "array",
            "description": "Direct links to images (PNG, JPEG, WebP, TIFF, BMP, GIF) or PDFs, or a link to a text file with one link per line (a sheet published as CSV works too). Scanned PDFs are read page by page.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "file": {
            "title": "Or upload your own file",
            "type": "string",
            "description": "Upload one of your own images or PDFs (it goes to a key-value store in your account)."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The languages in your images. Pick only the ones you need: each extra language makes reading slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "swe",
                "dan",
                "nor",
                "fin",
                "est",
                "lav",
                "lit",
                "hun",
                "ron",
                "tur",
                "rus",
                "ukr",
                "ell",
                "ara",
                "heb",
                "hin",
                "jpn",
                "kor",
                "chi_sim",
                "chi_tra",
                "vie",
                "ind"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Estonian",
                "Latvian",
                "Lithuanian",
                "Hungarian",
                "Romanian",
                "Turkish",
                "Russian",
                "Ukrainian",
                "Greek",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Japanese",
                "Korean",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Vietnamese",
                "Indonesian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "layout": {
            "title": "Page layout",
            "enum": [
              "auto",
              "block",
              "sparse",
              "line"
            ],
            "type": "string",
            "description": "How the text sits on the image. Automatic suits documents; 'scattered text' suits screenshots and photos.",
            "default": "auto"
          },
          "includeWords": {
            "title": "Include every word with its box",
            "type": "boolean",
            "description": "Also list each word with its confidence (0-100) and position [left, top, width, height] in pixels.",
            "default": false
          },
          "maxPdfPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "type": "integer",
            "description": "Read at most this many pages of each PDF (from the first page).",
            "default": 50
          },
          "maxItems": {
            "title": "Max pages in total",
            "minimum": 1,
            "type": "integer",
            "description": "The most images and PDF pages read in one run.",
            "default": 1000
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "all",
              "new"
            ],
            "type": "string",
            "description": "'All' lists everything found now. 'Only new' lists results never seen in earlier runs. 'New, changed and removed' also lists results that changed or disappeared. The first scheduled run counts everything as new; use 'Baseline only' to start cheaply.",
            "default": "all"
          },
          "stateKey": {
            "title": "Memory name (optional)",
            "type": "string",
            "description": "Leave empty: each saved task keeps its own memory. Set a name to share one memory between tasks, or a new name to start over.",
            "default": ""
          },
          "resetState": {
            "title": "Forget earlier runs",
            "type": "boolean",
            "description": "Starts from an empty memory: every result counts as new again.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "We POST a summary plus up to 100 new, changed or removed results here when something changed. Works with Slack incoming webhooks (choose the Slack format), Zapier, Make and n8n.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack"
            ],
            "type": "string",
            "description": "JSON for automation tools; 'Slack message' sends one line of text.",
            "default": "json"
          },
          "webhookAlways": {
            "title": "Call the webhook on every run",
            "type": "boolean",
            "description": "By default the webhook is called only when something changed or a source failed.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}