{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR - Extract Text from Images & Scanned PDFs",
    "description": "Extract text from images and scanned PDFs in bulk with Tesseract OCR: screenshots, documents, receipts, posters. 12 languages, text with paragraphs, word count, confidence and optional line boxes. URLs, scanned PDF pages or another Actor's dataset. No external AI API.",
    "version": "1.0",
    "x-build-id": "TZtTrIHBajm64PRcX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teddythebuilder~image-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teddythebuilder-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/teddythebuilder~image-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-teddythebuilder-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/teddythebuilder~image-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-teddythebuilder-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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Images to read: PNG, JPG, WebP, GIF, BMP, TIFF. One URL per line.",
            "default": [
              "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
            ],
            "items": {
              "type": "string"
            }
          },
          "pdfUrls": {
            "title": "Scanned PDF URLs",
            "type": "array",
            "description": "Scanned PDFs (or any PDF): each page is rendered and OCR'd. For PDFs that already contain selectable text, the PDF Text Extractor is cheaper.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID with image URLs",
            "type": "string",
            "description": "Read image/PDF URLs from another Apify dataset, e.g. the output of an image scraper or the Bulk Image & File Downloader (field fileUrl)."
          },
          "datasetUrlField": {
            "title": "URL field",
            "type": "string",
            "description": "Field in the dataset items that holds the URL (or a list of URLs), e.g. imageUrl, fileUrl, url.",
            "default": "url"
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Languages in the images. Pick all that occur; more languages are slower. English is the default.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "swe",
                "nor",
                "dan",
                "fin",
                "pol"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Polish"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "layout": {
            "title": "Page layout",
            "enum": [
              "auto",
              "sparse",
              "single-block",
              "single-line"
            ],
            "type": "string",
            "description": "Auto works for documents and screenshots. Sparse finds scattered text (posters, product photos, memes). Single block for one paragraph, single line for banners and captions.",
            "default": "auto"
          },
          "minWordConfidence": {
            "title": "Min word confidence (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop words Tesseract is less sure about, e.g. 40 to remove noise from photos. 0 = keep all words.",
            "default": 0
          },
          "includeLines": {
            "title": "Include lines with boxes",
            "type": "boolean",
            "description": "Also return every text line with its confidence and bounding box [x, y, width, height] in original image pixels.",
            "default": false
          },
          "maxItems": {
            "title": "Max images / PDF pages",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many images and PDF pages. You pay per image or page processed.",
            "default": 100
          },
          "maxPdfPages": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "OCR at most this many pages of each PDF (from the start). 0 = all pages.",
            "default": 20
          },
          "pdfDpi": {
            "title": "PDF render resolution (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "200 is a good balance; use 300 for small print.",
            "default": 200
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Skip larger files (free).",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel OCR workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Images processed at the same time. Defaults to the number of CPU cores of the run (raise memory for more cores)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}