{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR: Markdown, Word Boxes & RAG Chunks",
    "description": "Extract text from PNG, JPG, TIFF and WebP images offline with Tesseract. Markdown, plain text, word boxes, confidence scores and RAG chunks. No API key.",
    "version": "1.0",
    "x-build-id": "9ea7m96db87upW0P0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bongo-seakhoa~image-to-text-ocr-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bongo-seakhoa-image-to-text-ocr-markdown",
        "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/bongo-seakhoa~image-to-text-ocr-markdown/runs": {
      "post": {
        "operationId": "runs-sync-bongo-seakhoa-image-to-text-ocr-markdown",
        "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/bongo-seakhoa~image-to-text-ocr-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-bongo-seakhoa-image-to-text-ocr-markdown",
        "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": {
          "sources": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to PNG, JPEG, TIFF, WebP, BMP or GIF files (http or https). The format is read from the file's first bytes, not its name. Redirects are followed and Dropbox '?dl=0' links are turned into downloads. PDFs are refused: use the PDF to Markdown & RAG Chunks Actor for those.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store with images (optional)",
            "type": "string",
            "description": "Pick a key-value store that holds image files. Without record keys below, every record whose key has an image file extension (.png, .jpg, .tiff ...) or no extension at all (like scan-0001) is read, up to 1,000; the format is read from each file's first bytes. Records named like other files (.json, .txt ...) are left out and counted under ignored_keys in the SUMMARY record."
          },
          "keyValueStoreKeys": {
            "title": "Record keys (optional)",
            "type": "array",
            "description": "Keys of image records in the store picked above. Leave empty to read every image record.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "minItems": 1,
            "maxItems": 3,
            "type": "array",
            "description": "Languages in your images, at most 3. Choose only the ones you need: each extra language slows OCR down, and mixing scripts lowers accuracy.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "hun"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Hungarian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "layout": {
            "title": "Layout",
            "enum": [
              "auto",
              "single_block",
              "sparse"
            ],
            "type": "string",
            "description": "'auto' lets Tesseract find the text blocks (pages, documents). 'single_block' treats the image as one block of text (a cropped paragraph or label). 'sparse' looks for scattered text in no particular order (screenshots, forms, signs).",
            "default": "auto"
          },
          "autoRotate": {
            "title": "Detect and fix rotation",
            "type": "boolean",
            "description": "Detect pages turned by 90, 180 or 270 degrees and turn them upright before OCR. Skipped for images under about 300 pixels tall.",
            "default": true
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "convert",
              "estimate"
            ],
            "type": "string",
            "description": "'convert' runs OCR. 'estimate' only counts the images and TIFF frames that would be read and shows the projected price. It charges none of this Actor's events (Apify's standard Actor start fee still applies).",
            "default": "convert"
          },
          "outputs": {
            "title": "Outputs",
            "minItems": 1,
            "type": "array",
            "description": "What to produce. Text and Markdown go into each image row (Markdown also into a .md file); words and lines are saved as JSON files with pixel boxes and confidence; chunks become their own rows.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "markdown",
                "words",
                "lines",
                "chunks"
              ],
              "enumTitles": [
                "Plain text",
                "Markdown",
                "Word boxes (JSON file)",
                "Line boxes (JSON file)",
                "RAG chunks"
              ]
            },
            "default": [
              "text",
              "markdown",
              "chunks"
            ]
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 8000,
            "type": "integer",
            "description": "Maximum length of each chunk in characters (about 4 characters per token). Chunks break at headings, paragraphs and sentences.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Characters repeated between consecutive chunks. At most half the chunk size.",
            "default": 150
          },
          "maxPixelsMp": {
            "title": "Downscale above (megapixels)",
            "minimum": 2,
            "maximum": 20,
            "type": "integer",
            "description": "Larger images are scaled down to this size before OCR, which keeps memory and time in check. Images over 60 megapixels are refused with IMAGE_TOO_LARGE.",
            "default": 12
          },
          "maxFileSizeMb": {
            "title": "Maximum file size",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger files are not downloaded and are reported as failed (not charged). The limit is also capped at a quarter of the run's memory: 128 MB at 512 MB, 256 MB at the default 1 GB.",
            "default": 50
          },
          "maxFramesPerFile": {
            "title": "Maximum frames per TIFF",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Each page of a multi-page TIFF is read and charged as its own image, up to this many per file. Further pages are left out (warning FRAMES_TRUNCATED) and not charged. GIF and animated WebP files are read at their first frame only.",
            "default": 50
          },
          "perImageTimeoutSecs": {
            "title": "Time limit per image",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "An image (or TIFF frame) that takes longer fails with TIMEOUT and is not charged.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}