{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR API - Image to Text, Photo to Text & Receipt OCR",
    "description": "Bulk image OCR and photo to text for receipts, screenshots and document photos. Extract text from image URLs, datasets or base64 as plain text or Markdown; optional receipt fields and table rows. $0.003 per image with text on Free and Bronze; no-text and failed results are free.",
    "version": "0.1",
    "x-build-id": "4Gi95DczkCbsETomj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidytools~image-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidytools-image-to-text-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/tidytools~image-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-tidytools-image-to-text-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/tidytools~image-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-tidytools-image-to-text-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": {
          "urls": {
            "title": "Image or PDF URLs",
            "type": "array",
            "description": "First run: try one clear image with visible text. Text-free images can return no_text; no_text results are free. If text was missed, crop or enlarge it, then retry (Language hint may help). One direct image URL per line (JPEG, PNG, WebP, GIF first frame, AVIF, HEIC, TIFF; max 20 MB). PDFs up to 15 MB are read page by page; SVG is unsupported. Google Drive, Dropbox and OneDrive share links are accepted. Or use imageUrls, datasetId or imagesBase64. Invalid lines are free; duplicate URLs run once.",
            "items": {
              "type": "string"
            }
          },
          "imageUrls": {
            "title": "Image URL list or file (optional)",
            "type": "array",
            "description": "The same as \"Image URLs\", in the URL list editor: you can also upload or link a text/CSV file of image links.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "mode": {
            "title": "Output format",
            "enum": [
              "text",
              "markdown",
              "receipt_fields",
              "table_rows"
            ],
            "type": "string",
            "description": "Plain text keeps line breaks; Markdown keeps tables. Table rows adds columns/rows for regular pipe tables (outer | optional); tableReview flags the rest. Receipt / invoice fields keep text and add receipt.vendor/date/total/currency/review from explicit English, Taiwan (發票日期, 總計, NT$), Brazilian (R$), Spanish (Fecha, Total) or Indonesian (Rp/IDR) labels; unclear ones need review. Not accounting-grade: check the image. One image-ocr event per image/PDF page with text; no-text and failures free.",
            "default": "text"
          },
          "language": {
            "title": "Language hint (optional)",
            "type": "string",
            "description": "Main language of the text, e.g. Japanese, Traditional Chinese, German. Optional: the text is transcribed in its original language either way; a hint can help with small or stylized script."
          },
          "preserveCheckboxes": {
            "title": "Keep form checkboxes (☐ ☑ ☒)",
            "type": "boolean",
            "description": "Images only: write ☐ (empty), ☑ (check mark) or ☒ (X mark, selected) for a form checkbox with readable label text and a clear state; unclear boxes keep only their label. An answer of only ☐ ☑ ☒, whitespace and Markdown layout is no_text and free (charged with the option off); anything else visible, even a lone X, is charged. Long images read by page OCR get checkboxReview:true. PDFs ignore this option. Event and price unchanged.",
            "default": false
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Take image URLs from another Actor run's dataset (e.g. a scraper's image field)."
          },
          "datasetField": {
            "title": "Dataset field",
            "type": "string",
            "description": "Field with the image URL, e.g. \"imageUrl\", or an array of image URLs such as \"images\" (up to 100 per item). Empty = the first URL field found."
          },
          "imagesBase64": {
            "title": "Base64 images (optional)",
            "type": "array",
            "description": "Images sent as base64 strings, data URLs (data:image/png;base64,...) or objects {\"id\": \"receipt-17\", \"data\": \"<base64>\"} (the id is returned with the result), for images that are not online. Mainly for API and AI-agent use."
          },
          "maxConcurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many images are transcribed at the same time.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Only used to download images from sites that block data-center requests. Apify proxy usage is billed to your Apify account."
          },
          "maxSecondsPerImage": {
            "title": "Time limit per image (seconds)",
            "minimum": 30,
            "maximum": 300,
            "type": "integer",
            "description": "An image that is not finished in this time (slow download or a very long text) is reported as failed with errorType \"timeout\" and is not charged, so one stuck image cannot hold the run. A dense page can need 1-3 minutes. If the first answer is cut off and page OCR fails, a tall image may use up to two extra region reads when time allows; it can still be marked truncated. The limit stays 30-300 seconds and one image with returned text has one image-ocr charge.",
            "default": 180
          },
          "maxPdfPages": {
            "title": "Maximum PDF pages per file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "At most this many selected pages are read from each PDF; extra pages are skipped without charge. Default 50.",
            "default": 50
          },
          "pageRange": {
            "title": "PDF page range (optional)",
            "type": "string",
            "description": "One-based PDF pages, such as 1-5,8. Empty reads the first pages up to Maximum PDF pages."
          },
          "mergePdfPages": {
            "title": "One result row per PDF",
            "type": "boolean",
            "description": "Combine selected PDF pages into one dataset row, keeping a pages array and charging one image-ocr event for each page with text. Default is one row per page.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}