{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text & Scanned PDF OCR to RAG Chunks",
    "description": "Image to text OCR for photos and scanned PDFs: text, Markdown and token-counted chunks with page numbers and a confidence score. Tesseract, 37 languages, no API key. Blank pages and failed files are free. Not affiliated with any OCR vendor.",
    "version": "1.0",
    "x-build-id": "N4yLcK629iy1OKtmr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mmdincer~image-ocr-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mmdincer-image-ocr-rag",
        "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/mmdincer~image-ocr-rag/runs": {
      "post": {
        "operationId": "runs-sync-mmdincer-image-ocr-rag",
        "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/mmdincer~image-ocr-rag/run-sync": {
      "post": {
        "operationId": "run-sync-mmdincer-image-ocr-rag",
        "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 and PDF URLs",
            "maxItems": 200,
            "type": "array",
            "description": "Direct links to image files or PDFs, one per line. Up to 200 per run. The link must return the file itself (for example <code>https://…/scan.jpg</code>), not a web page that shows it. A PDF is read page by page.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Read links from a dataset",
            "type": "string",
            "description": "Optional. Pick an Apify dataset whose items contain image or PDF links. The Actor looks for <code>imageUrl</code>, <code>fileUrl</code>, <code>pdfUrl</code>, <code>screenshotUrl</code>, <code>url</code>, <code>link</code> and similar fields, which is how you chain it after a crawler without copying links by hand. The dataset is opened read-only."
          },
          "languages": {
            "title": "Languages in the images",
            "maxItems": 4,
            "type": "array",
            "description": "Languages that appear in the text, up to 4 (for example English and German together). The first one matters most. Each extra language slows recognition down, so pick only what is on the page. The default is English.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "tur",
                "rus",
                "ukr",
                "pol",
                "ces",
                "swe",
                "nor",
                "dan",
                "fin",
                "ron",
                "hun",
                "bul",
                "hrv",
                "srp",
                "slk",
                "cat",
                "est",
                "lav",
                "lit",
                "heb",
                "ara",
                "hin",
                "ben",
                "ind",
                "vie",
                "tha",
                "jpn",
                "kor",
                "chi_sim",
                "chi_tra"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Turkish",
                "Russian",
                "Ukrainian",
                "Polish",
                "Czech",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Romanian",
                "Hungarian",
                "Bulgarian",
                "Croatian",
                "Serbian",
                "Slovak",
                "Catalan",
                "Estonian",
                "Latvian",
                "Lithuanian",
                "Hebrew",
                "Arabic",
                "Hindi",
                "Bengali",
                "Indonesian",
                "Vietnamese",
                "Thai",
                "Japanese",
                "Korean",
                "Chinese (Simplified)",
                "Chinese (Traditional)"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "both",
              "chunks",
              "document"
            ],
            "type": "string",
            "description": "<b>Document and chunks</b> writes one document row per file plus its chunk rows. <b>Chunks only</b> skips the document row, so the dataset is exactly what an embedding job wants. <b>Document only</b> returns the text, Markdown and quality numbers without chunking.",
            "default": "both"
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 64,
            "maximum": 4096,
            "type": "integer",
            "description": "Token budget per chunk, counted with the cl100k_base tokenizer that OpenAI embedding and chat models use. 512 is a good default for retrieval; use 256 for narrow facts such as receipts and 1024 or more for long documents.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2048,
            "type": "integer",
            "description": "Text from the end of one chunk repeated at the start of the next, in whole paragraphs, so an answer that straddles a boundary is still findable. At most half the chunk size.",
            "default": 64
          },
          "lowConfidenceBelow": {
            "title": "Flag chunks below confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Chunks whose mean OCR confidence (0 to 100) is under this number get <code>lowConfidence: true</code>, so your pipeline can skip or review them. Nothing is removed. 70 is a careful default; clean scans score 90 or more.",
            "default": 70
          },
          "startPage": {
            "title": "First page",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "For PDFs and multi-page TIFFs: the first page to read, 1-based. Use it to skip a cover page. Single images ignore it.",
            "default": 1
          },
          "maxPagesPerFile": {
            "title": "Maximum pages per file",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Pages read from one PDF or multi-page TIFF, counted from the first page. Up to 200. Each page that contains text is charged once.",
            "default": 50
          },
          "pdfDpi": {
            "title": "PDF resolution (DPI)",
            "minimum": 100,
            "maximum": 300,
            "type": "integer",
            "description": "The resolution a PDF page is drawn at before recognition. 200 reads normal print well. Use 300 for small type, 150 for faster, rougher reads. Very large pages are drawn smaller automatically.",
            "default": 200
          },
          "enhance": {
            "title": "Clean up images first",
            "type": "boolean",
            "description": "Turns the image grey, stretches its contrast and enlarges small images before recognition. Turn it off only if your images are already clean scans at a good size.",
            "default": true
          },
          "autoRotate": {
            "title": "Fix sideways and upside-down pages",
            "type": "boolean",
            "description": "When a page reads badly, the Actor checks whether it is rotated by 90, 180 or 270 degrees and reads it again the right way up. It costs nothing extra and only runs on pages that read poorly the first time.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Add the <code>markdown</code> field to the document row: headings, paragraphs and lists rebuilt from the layout. Turn it off to keep the dataset smaller.",
            "default": true
          },
          "includePages": {
            "title": "Include page details",
            "type": "boolean",
            "description": "Add a <code>pages</code> array to the document row with the status, confidence, size and text of every page.",
            "default": false
          },
          "maxFiles": {
            "title": "Maximum files",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound on files read in one run, counting links from the list and from the dataset together.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files larger than this are skipped instead of downloaded, and reported as too_large.",
            "default": 50
          },
          "maxChunksPerFile": {
            "title": "Maximum chunks per file",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Safety cap on chunk rows for one file. The document row always holds the whole text.",
            "default": 1000
          },
          "requestsPerSecond": {
            "title": "Downloads per second (per host)",
            "minimum": 0.2,
            "maximum": 10,
            "type": "number",
            "description": "How fast files are downloaded from one server. Lower it to 1 when all your images come from one small server. The Actor never retries a refusal: a 403 or 429 marks the file as blocked and no more files are requested from that host.",
            "default": 2
          },
          "concurrency": {
            "title": "Pages read at the same time",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Optional. Recognition is CPU-bound, so by default the Actor reads about one page per GB of run memory. Leave empty unless you changed the memory and want to override it."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Only needed when an image host blocks data-centre IP addresses. Off by default."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}