{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR Text Extractor - Images & Scanned PDFs to Text",
    "description": "Extract text from images (PNG, JPG, TIFF, WEBP, BMP, GIF) and scanned PDFs with Tesseract OCR in 28 languages. Per-page text, confidence scores, optional word boxes, automatic text-layer detection for born-digital PDFs. No API key, no browser. JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "jaIQpQ6D0UFiqdATk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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 / PDF URLs",
            "type": "array",
            "description": "Direct links to images (PNG, JPG, TIFF, WEBP, BMP, GIF) or PDF files, one per line. Each file is downloaded and recognised. Duplicates are collapsed. <b>Leave empty and the run returns a small free sample.</b>",
            "items": {
              "type": "string"
            }
          },
          "urlsFromFile": {
            "title": "Import URLs from a file (one per line)",
            "type": "string",
            "description": "Bulk-load links. Either <b>paste the whole list</b> (one URL per line), or give <b>a single link</b> to a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link, or an Apify key-value-store record. Blank lines, <code>#</code> comments, CRLF, a UTF-8 BOM, quotes and extra CSV columns all parse. A file that cannot be read says so and charges nothing."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Language(s) of the text. Pick more than one for mixed documents (they are combined, e.g. English + German). Fewer languages = faster and more accurate.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "rus",
                "ukr",
                "tur",
                "ara",
                "heb",
                "hin",
                "jpn",
                "kor",
                "chi_sim",
                "chi_tra",
                "ces",
                "swe",
                "dan",
                "nor",
                "fin",
                "hun",
                "ron",
                "vie",
                "ind",
                "tha"
              ],
              "enumTitles": [
                "English (eng)",
                "German (deu)",
                "French (fra)",
                "Spanish (spa)",
                "Italian (ita)",
                "Portuguese (por)",
                "Dutch (nld)",
                "Polish (pol)",
                "Russian (rus)",
                "Ukrainian (ukr)",
                "Turkish (tur)",
                "Arabic (ara)",
                "Hebrew (heb)",
                "Hindi (hin)",
                "Japanese (jpn)",
                "Korean (kor)",
                "Chinese Simplified (chi_sim)",
                "Chinese Traditional (chi_tra)",
                "Czech (ces)",
                "Swedish (swe)",
                "Danish (dan)",
                "Norwegian (nor)",
                "Finnish (fin)",
                "Hungarian (hun)",
                "Romanian (ron)",
                "Vietnamese (vie)",
                "Indonesian (ind)",
                "Thai (tha)"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageSegmentation": {
            "title": "Page layout (segmentation mode)",
            "enum": [
              "auto",
              "columns",
              "single_block",
              "single_line",
              "single_word",
              "sparse",
              "sparse_osd",
              "raw_line"
            ],
            "type": "string",
            "description": "How Tesseract should read the page. <b>Automatic</b> handles most documents. Use <b>sparse</b> for screenshots, receipts and labels with scattered text, <b>single_line</b> for captchas/labels/serial numbers, <b>single_block</b> for a clean paragraph.",
            "default": "auto"
          },
          "preferTextLayer": {
            "title": "Use the PDF text layer when present",
            "type": "boolean",
            "description": "For PDFs that already contain selectable text (born-digital documents), read that text directly instead of rendering and OCR-ing the page - exact and much faster. Pages without a text layer (scans) are always OCR-ed. Each page reports which method was used.",
            "default": true
          },
          "dpi": {
            "title": "PDF render resolution (DPI)",
            "minimum": 72,
            "maximum": 400,
            "type": "integer",
            "description": "Resolution used to rasterise PDF pages before OCR. 200 is a good default; 300 helps small print, 150 is faster for clean large text.",
            "default": 200
          },
          "includePageText": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Add a <code>pages[]</code> array with each page's text, word count, confidence and method, on top of the concatenated <code>text</code>. Turn off for a leaner record.",
            "default": true
          },
          "includeWords": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add a <code>words[]</code> array with every recognised word, its confidence (0-100) and bounding box (left, top, width, height in pixels of the recognised image). Useful for highlighting, redaction, form parsing and layout reconstruction. Increases record size.",
            "default": false
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Cap how many pages to process per PDF (you are charged per page). 0 = all pages. Images always count as one page.",
            "default": 20
          },
          "outputFields": {
            "title": "Output fields (leave empty for all)",
            "type": "array",
            "description": "Pick the fields you want and every record is trimmed to exactly those - handy for lean CSV/Sheets exports. Open the dropdown and tick, or start typing to filter.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "url",
                "filename",
                "sourceType",
                "status",
                "error",
                "sizeBytes",
                "mimeType",
                "pageCount",
                "pagesProcessed",
                "method",
                "languages",
                "pageSegmentation",
                "text",
                "wordCount",
                "charCount",
                "lineCount",
                "meanConfidence",
                "minPageConfidence",
                "width",
                "height",
                "pages",
                "words",
                "durationMs",
                "scrapedAt"
              ],
              "enumTitles": [
                "Record type (type)",
                "Source URL (url)",
                "Filename (filename)",
                "Source type image/pdf (sourceType)",
                "Status (status)",
                "Error (error)",
                "Size in bytes (sizeBytes)",
                "Detected MIME type (mimeType)",
                "Page count (pageCount)",
                "Pages processed (pagesProcessed)",
                "Method ocr/text-layer/mixed (method)",
                "Languages used (languages)",
                "Segmentation mode (pageSegmentation)",
                "Full text (text)",
                "Word count (wordCount)",
                "Character count (charCount)",
                "Line count (lineCount)",
                "Mean OCR confidence 0-100 (meanConfidence)",
                "Lowest page confidence (minPageConfidence)",
                "Image width px (width)",
                "Image height px (height)",
                "Per-page text (pages)",
                "Word boxes (words)",
                "Processing time ms (durationMs)",
                "Scraped at (scrapedAt)"
              ]
            }
          },
          "maxItems": {
            "title": "Max files",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of files to process in one run (after de-duplication).",
            "default": 100
          },
          "maxFileMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "type": "integer",
            "description": "Skip any file larger than this. A skipped file is reported with an error and never charged.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Files are downloaded directly by default. Enable a proxy only if a host blocks the downloader (e.g. returns 403). OCR itself runs inside the actor and needs no proxy."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}