{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR: Scanned PDF & Image to Text (Word Boxes, Searchable PDF)",
    "description": "OCR scanned PDFs, photos and images to text with Tesseract: per-page text, word boxes with confidence, optional searchable PDF. 28 languages, multi-page PDF and TIFF, file links or another Actor's dataset. Runs on Apify, no outside OCR API. $0.002 per page, no start fee.",
    "version": "0.1",
    "x-build-id": "cZhtH0XKOW6l2Wo4Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/open-data-tools~ocr-pdf-image-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-open-data-tools-ocr-pdf-image-to-text",
        "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/open-data-tools~ocr-pdf-image-to-text/runs": {
      "post": {
        "operationId": "runs-sync-open-data-tools-ocr-pdf-image-to-text",
        "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/open-data-tools~ocr-pdf-image-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-open-data-tools-ocr-pdf-image-to-text",
        "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": "PDF or image links",
            "type": "array",
            "description": "One direct file link per line: scanned or photographed PDFs (any number of pages), PNG, JPEG, TIFF (multi-page too), WEBP, BMP or GIF. Dropbox share links work. Web pages and social media, Google and Amazon links are refused and not charged.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset from another Actor",
            "type": "string",
            "description": "Optional. OCR the file links in another Actor's results, for example a document, invoice or image scraper. In an Actor-to-Actor integration set it to {{resource.defaultDatasetId}}."
          },
          "urlField": {
            "title": "Link field (optional)",
            "type": "string",
            "description": "Field in the dataset that holds the file link(s). Leave empty to detect it (fileUrl, pdfUrl, documentUrl, imageUrl, image, images, downloadUrl, attachmentUrl, url, link). Dots reach nested fields (files.0.url); separate several with commas."
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Languages in the documents. Pick one or more (each extra language makes OCR a little slower). English by default.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "swe",
                "dan",
                "nor",
                "fin",
                "tur",
                "rus",
                "ukr",
                "ell",
                "ron",
                "hun",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor",
                "ara",
                "heb",
                "hin",
                "vie",
                "ind"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Turkish",
                "Russian",
                "Ukrainian",
                "Greek",
                "Romanian",
                "Hungarian",
                "Chinese (simplified)",
                "Chinese (traditional)",
                "Japanese",
                "Korean",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Vietnamese",
                "Indonesian"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageLayout": {
            "title": "Page layout",
            "enum": [
              "3",
              "1",
              "4",
              "6",
              "11",
              "12"
            ],
            "type": "string",
            "description": "How the text is laid out on the page. Automatic works for books, letters and multi-column pages.",
            "default": "3"
          },
          "pages": {
            "title": "Pages (optional)",
            "type": "string",
            "description": "Which pages to read in each PDF or multi-page TIFF, for example 1-5, 9, 12-. Leave empty for all pages."
          },
          "dpi": {
            "title": "Resolution for PDFs (DPI)",
            "minimum": 100,
            "maximum": 600,
            "type": "integer",
            "description": "PDF pages are turned into images at this resolution before OCR. 200 reads normal print (10 pt and up) as well as 300 in our tests and is twice as fast; use 300 for small print or footnotes, 400 for tiny text. Same price. Images are read at their own size.",
            "default": 200
          },
          "searchablePdf": {
            "title": "Make a searchable PDF",
            "type": "boolean",
            "description": "Also create one searchable PDF per file (grayscale page image with an invisible text layer you can search and copy). Same price.",
            "default": false
          },
          "includeWords": {
            "title": "Word boxes and confidence",
            "type": "boolean",
            "description": "Add every word with its confidence (0-100) and box (x, y, w, h in pixels of the page image) to each page row.",
            "default": true
          },
          "maxPagesPerFile": {
            "title": "Maximum pages per file",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Longer files are read up to this many pages. You pay only for pages that return text.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}