{
  "openapi": "3.0.1",
  "info": {
    "title": "Arabic Image OCR & Saudi Invoice QR Reader",
    "description": "Fast Arabic + English OCR for screenshots, documents and images (normalised and raw text, lines with confidence, RTL order), plus exact fields from Saudi ZATCA e-invoice QR codes (signature not checked). For receipts and Arabic-Indic digits use Arabic Receipt Reader.",
    "version": "0.1",
    "x-build-id": "hkuaaFFaAvlP1pRJk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/saif-tools~arabic-image-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-saif-tools-arabic-image-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/saif-tools~arabic-image-ocr/runs": {
      "post": {
        "operationId": "runs-sync-saif-tools-arabic-image-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/saif-tools~arabic-image-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-saif-tools-arabic-image-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "text",
              "qr"
            ],
            "type": "string",
            "description": "<b>text</b>: plain-text OCR (fast, cheapest) for screenshots, documents and clean images. Weak on Arabic-Indic digits (٠-٩): for receipts, invoices and prices use the <b>Arabic Receipt Reader</b> actor.<br><b>qr</b>: exact fields from a Saudi ZATCA e-invoice QR code only (no OCR). Images without a ZATCA QR are free.",
            "default": "text"
          },
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Public links to JPEG, PNG, WebP, GIF, BMP or TIFF images. Images over 4 megapixels are downscaled to 4 MP before OCR. Leave empty to try the bundled sample image (free).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStoreRecords": {
            "title": "Key-value store records",
            "type": "array",
            "description": "Images already uploaded to an Apify key-value store. Write <code>record-key</code> for this run's default store, or <code>store-name-or-id/record-key</code>.",
            "items": {
              "type": "string"
            }
          },
          "includeQrFields": {
            "title": "Plain-text mode: also read Saudi e-invoice QR fields",
            "type": "boolean",
            "description": "Text mode only. Decodes a ZATCA QR if one is present. Adds one exact-qr-fields event per image where such a QR is found; images without one cost nothing extra.",
            "default": false
          },
          "languages": {
            "title": "Text mode: Tesseract languages",
            "type": "string",
            "description": "Text mode only. Installed: ara, eng. Use ara+eng for mixed images, eng for English only.",
            "default": "ara+eng"
          },
          "pageLayout": {
            "title": "Text mode: page layout",
            "enum": [
              "single-column",
              "auto",
              "block",
              "sparse"
            ],
            "type": "string",
            "description": "How Tesseract splits the image into text blocks.",
            "default": "single-column"
          },
          "upscale": {
            "title": "Text mode: upscale small text",
            "enum": [
              "auto",
              "off",
              "2x",
              "3x"
            ],
            "type": "string",
            "description": "Auto enlarges images whose text is too small for OCR.",
            "default": "auto"
          },
          "deskew": {
            "title": "Straighten tilted images",
            "type": "boolean",
            "description": "Detects and corrects rotation up to ±10°.",
            "default": true
          },
          "threshold": {
            "title": "Text mode: binarisation",
            "enum": [
              "none",
              "otsu",
              "adaptive"
            ],
            "type": "string",
            "description": "Converts the image to black and white before OCR. Try adaptive for photos with uneven lighting.",
            "default": "none"
          },
          "digitSecondPass": {
            "title": "Arabic-Indic digit second pass",
            "type": "boolean",
            "description": "Re-reads Arabic-Indic and Persian digits with a dedicated digit classifier.",
            "default": true
          },
          "maskQrCodes": {
            "title": "Hide QR codes from OCR",
            "type": "boolean",
            "description": "Blanks detected QR codes before OCR so they don't turn into junk text.",
            "default": true
          },
          "stripTatweel": {
            "title": "Remove tatweel (ـ) in the normalised text",
            "type": "boolean",
            "description": "The normalised fields drop tatweel and map Arabic-Indic and Persian digits to 0-9 (٫ → . and ٬ → ,). The raw fields keep the text as read.",
            "default": true
          },
          "outputLines": {
            "title": "Include lines with confidence",
            "type": "boolean",
            "description": "One entry per text line with its confidence, bounding box and direction.",
            "default": true
          },
          "outputWords": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Adds the words of each line with their bounding boxes. Makes rows much larger.",
            "default": false
          },
          "maxImageSizeMb": {
            "title": "Maximum image size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped with a free error row.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many images are processed at the same time.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}