{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR - Read Text from Images, Scans & PDFs",
    "description": "OCR for images, scans and PDFs: text, Markdown and each line's position per image or page, plus QR codes and barcodes. Reads JPEG, PNG, HEIC, TIFF and PDF links (page ranges, passwords), uploads and other Actors' datasets. Pages without text are free.",
    "version": "0.1",
    "x-build-id": "LE5SQrnIoOht0Ki1p"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/akhil_rajesh~image-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-akhil_rajesh-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/akhil_rajesh~image-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-akhil_rajesh-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/akhil_rajesh~image-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-akhil_rajesh-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": {
          "files": {
            "title": "Image and PDF links",
            "type": "array",
            "description": "Links to images (JPEG, PNG, WebP, GIF, BMP, TIFF, HEIC, AVIF, JPEG 2000) or PDFs, one per line. Each image and each PDF page becomes one row with its text. Dropbox and Google Drive share links and article pages that name their PDF (arXiv, journals) are followed to the file. data: URLs work too.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Upload files",
            "type": "array",
            "description": "Images or PDFs from your computer. They are stored in a key-value store in your account and read from there."
          },
          "inputDataset": {
            "title": "Dataset with links",
            "type": "string",
            "description": "Read the text of images or PDFs another Actor found: pick its dataset. Links are taken from the field below, or from the usual fields (url, imageUrl, fileUrl, image, pdfUrl, displayUrl, images...)."
          },
          "datasetUrlField": {
            "title": "Field with the links",
            "type": "string",
            "description": "The dataset field that holds the links, such as imageUrl, or images for a list. Use dots for nested fields (media.0.url). Leave empty to try the usual fields."
          },
          "mode": {
            "title": "Speed",
            "enum": [
              "accurate",
              "fast"
            ],
            "type": "string",
            "description": "Accurate reads small and blurred text better. Fast uses a smaller recognition model for clean scans and screenshots. Both use the same text finder. Fast applies to the Auto language only.",
            "default": "accurate"
          },
          "language": {
            "title": "Language",
            "enum": [
              "auto",
              "korean",
              "eslav",
              "cyrillic",
              "arabic",
              "devanagari",
              "thai",
              "greek",
              "tamil",
              "telugu",
              "kannada"
            ],
            "type": "string",
            "description": "The script of the text. Auto covers English, Chinese, Japanese and about 50 Latin-script languages. For other scripts, choose the language: one per run.",
            "default": "auto"
          },
          "pdfText": {
            "title": "PDF pages",
            "enum": [
              "auto",
              "ocr",
              "textOnly"
            ],
            "type": "string",
            "description": "Most PDFs made on a computer carry their text, which is exact and fast to read. Scans don't, and are read with OCR. Choose OCR every page when a PDF's own text is garbled.",
            "default": "auto"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Read only these pages of each PDF or multi-page TIFF, such as 1-5, 8, 12- (page 12 to the end) or -3 (the last three). Leave empty for every page."
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "The password of password-protected PDFs. It is used for every PDF in the run, and never logged."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF or multi-page TIFF, from the first (or from the first page named in Pages).",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages and images",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many pages and images in all. Each one with text is a result.",
            "default": 1000
          },
          "minConfidence": {
            "title": "Min line confidence",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Leave out lines the OCR is less sure of than this (0 to 1). Real text usually scores above 0.8; 0.5 drops most noise from photos.",
            "default": 0.5
          },
          "includeLines": {
            "title": "Include lines with positions",
            "type": "boolean",
            "description": "Add each line's text, confidence and box (four corners in pixels) to the row. Turn off for text only.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Add each page as Markdown: headings, paragraphs and table rows, for AI tools and RAG pipelines. PDF pages with their own text get it from the PDF's layout.",
            "default": true
          },
          "readCodes": {
            "title": "Read QR codes and barcodes",
            "type": "boolean",
            "description": "Also decode QR codes, Data Matrix, PDF417, EAN, UPC, Code 128 and other barcodes on images and OCR'd pages. Free: a page with only a code counts as one result.",
            "default": true
          },
          "includeWords": {
            "title": "Include words",
            "type": "boolean",
            "description": "Add each word with its own box and confidence inside each line (bigger rows). Line boxes come in pixels and as 0-1 fractions of the page either way.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}