{
  "openapi": "3.0.1",
  "info": {
    "title": "Image OCR Extractor - Image to Text with Word Boxes",
    "description": "Read the text in images from any URL: JPG, PNG, WebP, GIF, TIFF and BMP screenshots, scans, signs and graphics. Get the full text, every line and word with its position and confidence, and the detected language. 100+ OCR languages.",
    "version": "0.1",
    "x-build-id": "VrX6WoAY3OwCUURZd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~image-ocr-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-image-ocr-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/fabrikit~image-ocr-extractor/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-image-ocr-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/fabrikit~image-ocr-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-image-ocr-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 URLs",
            "type": "array",
            "description": "Direct links to image files, one per line (right-click an image > Copy image address). data:image/...;base64 URLs also work. Duplicates are skipped. Links that return a web page, a PDF or another non-image file are reported as failed and not charged.",
            "default": [
              "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
              "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png"
            ],
            "items": {
              "type": "string"
            }
          },
          "ocrLanguages": {
            "title": "OCR language(s)",
            "type": "string",
            "description": "Tesseract language codes of the text in the images, joined with +: eng (default), spa, eng+spa, fra, deu, por, ita, nld, rus, ara, hin, jpn, chi_sim, kor... Up to 5. English and Spanish are built in; other languages are downloaded once at the start of the run. Fewer languages = faster and more accurate.",
            "default": "eng"
          },
          "layout": {
            "title": "Text layout",
            "enum": [
              "auto",
              "sparse",
              "block",
              "line"
            ],
            "type": "string",
            "description": "Auto works for documents, screenshots, tables and photos of signs. Sparse finds scattered text in no particular order (UI screenshots, infographics, diagrams). Single block treats the image as one block of text (a cropped paragraph, a label, a banner). Single line is for images that hold one line of text.",
            "default": "auto"
          },
          "minConfidence": {
            "title": "Minimum line confidence (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Lines that the OCR engine reads with a lower confidence are dropped. They are usually textures, logos or patterns mistaken for letters. Lower it to keep everything, raise it (60-80) for cleaner output from busy photos.",
            "default": 30
          },
          "enhanceImages": {
            "title": "Clean up images before OCR",
            "type": "boolean",
            "description": "Grayscale, contrast stretch, light-on-dark text inverted (dark mode, terminals), small screenshots enlarged and huge photos reduced. Turn off only if your images are already prepared for OCR.",
            "default": true
          },
          "includeLines": {
            "title": "Lines with positions",
            "type": "boolean",
            "description": "Add a lines array: the text of each line with its confidence and bounding box (x, y, width, height in pixels of the original image).",
            "default": true
          },
          "includeWords": {
            "title": "Words with positions",
            "type": "boolean",
            "description": "Add a words array: every word with its confidence, bounding box and line number. Useful to highlight or redact text, or to read forms by position. Makes records larger.",
            "default": false
          },
          "maskContacts": {
            "title": "Mask e-mails and phone numbers",
            "type": "boolean",
            "description": "Replace e-mail addresses and phone numbers in the text, lines and words with [email removed] / [phone removed]. US toll-free numbers stay. Turn off for your own images when you need them verbatim.",
            "default": true
          },
          "maxItems": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of images to read in this run (the first N links).",
            "default": 20
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped and reported as failed (not charged).",
            "default": 25
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Only used to download the images. Each image is downloaded directly first; if the host refuses (401/403/429), the download is retried through Apify datacenter proxy or your own proxy URLs. Residential proxy is not used.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}