{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text & PDF OCR: Searchable PDF, 100+ Languages",
    "description": "Image to text and PDF OCR for screenshots (dark mode too), photos, receipts and scanned PDFs. No OCR API key, built-in Tesseract. Bulk OCR from URLs, base64, an Apify dataset, CSV, Excel or Google Sheet. 100+ languages, RAG chunks, searchable PDF. From $1.20/1,000 OCR pages ($2 on the Free plan).",
    "version": "0.1",
    "x-build-id": "q7aULmBRrg6g9Smid"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamatama~image-pdf-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamatama-image-pdf-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/tamatama~image-pdf-ocr/runs": {
      "post": {
        "operationId": "runs-sync-tamatama-image-pdf-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/tamatama~image-pdf-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-tamatama-image-pdf-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": "Links to images (PNG, JPEG, TIFF incl. multi-page, WebP, GIF, BMP) or PDF files (scanned or mixed). The type is detected from the content, so links without an extension work. Up to 50 MB per file. You can also link a text file that lists URLs (up to 1,000), e.g. https://example.com/scans.txt. For a spreadsheet or a dataset of links, use the bulk fields below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Languages of the text, up to 3 (more languages make OCR slower). 100+ languages (123 language models, counting vertical Japanese, Chinese and Korean and historic variants). English is used if empty.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "afr",
                "amh",
                "ara",
                "asm",
                "aze",
                "aze_cyrl",
                "bel",
                "ben",
                "bod",
                "bos",
                "bre",
                "bul",
                "cat",
                "ceb",
                "ces",
                "chi_sim",
                "chi_sim_vert",
                "chi_tra",
                "chi_tra_vert",
                "chr",
                "cos",
                "cym",
                "dan",
                "deu",
                "div",
                "dzo",
                "ell",
                "enm",
                "epo",
                "est",
                "eus",
                "fao",
                "fas",
                "fil",
                "fin",
                "fra",
                "frk",
                "frm",
                "fry",
                "gla",
                "gle",
                "glg",
                "grc",
                "guj",
                "hat",
                "heb",
                "hin",
                "hrv",
                "hun",
                "hye",
                "iku",
                "ind",
                "isl",
                "ita",
                "ita_old",
                "jav",
                "jpn",
                "jpn_vert",
                "kan",
                "kat",
                "kat_old",
                "kaz",
                "khm",
                "kir",
                "kmr",
                "kor",
                "kor_vert",
                "lao",
                "lat",
                "lav",
                "lit",
                "ltz",
                "mal",
                "mar",
                "mkd",
                "mlt",
                "mon",
                "mri",
                "msa",
                "mya",
                "nep",
                "nld",
                "nor",
                "oci",
                "ori",
                "pan",
                "pol",
                "por",
                "pus",
                "que",
                "ron",
                "rus",
                "san",
                "sin",
                "slk",
                "slv",
                "snd",
                "spa",
                "spa_old",
                "sqi",
                "srp",
                "srp_latn",
                "sun",
                "swa",
                "swe",
                "syr",
                "tam",
                "tat",
                "tel",
                "tgk",
                "tha",
                "tir",
                "ton",
                "tur",
                "uig",
                "ukr",
                "urd",
                "uzb",
                "uzb_cyrl",
                "vie",
                "yid",
                "yor"
              ],
              "enumTitles": [
                "English",
                "Afrikaans",
                "Amharic",
                "Arabic",
                "Assamese",
                "Azerbaijani",
                "Azerbaijani (Cyrillic)",
                "Belarusian",
                "Bengali",
                "Tibetan",
                "Bosnian",
                "Breton",
                "Bulgarian",
                "Catalan",
                "Cebuano",
                "Czech",
                "Chinese (Simplified)",
                "Chinese (Simplified, vertical)",
                "Chinese (Traditional)",
                "Chinese (Traditional, vertical)",
                "Cherokee",
                "Corsican",
                "Welsh",
                "Danish",
                "German",
                "Dhivehi",
                "Dzongkha",
                "Greek",
                "English (Middle, 1100-1500)",
                "Esperanto",
                "Estonian",
                "Basque",
                "Faroese",
                "Persian",
                "Filipino",
                "Finnish",
                "French",
                "German (Fraktur)",
                "French (Middle, 1400-1600)",
                "Western Frisian",
                "Scottish Gaelic",
                "Irish",
                "Galician",
                "Greek (Ancient)",
                "Gujarati",
                "Haitian Creole",
                "Hebrew",
                "Hindi",
                "Croatian",
                "Hungarian",
                "Armenian",
                "Inuktitut",
                "Indonesian",
                "Icelandic",
                "Italian",
                "Italian (Old)",
                "Javanese",
                "Japanese",
                "Japanese (vertical)",
                "Kannada",
                "Georgian",
                "Georgian (Old)",
                "Kazakh",
                "Khmer",
                "Kyrgyz",
                "Kurdish (Kurmanji)",
                "Korean",
                "Korean (vertical)",
                "Lao",
                "Latin",
                "Latvian",
                "Lithuanian",
                "Luxembourgish",
                "Malayalam",
                "Marathi",
                "Macedonian",
                "Maltese",
                "Mongolian",
                "Maori",
                "Malay",
                "Burmese",
                "Nepali",
                "Dutch",
                "Norwegian",
                "Occitan",
                "Odia",
                "Punjabi",
                "Polish",
                "Portuguese",
                "Pashto",
                "Quechua",
                "Romanian",
                "Russian",
                "Sanskrit",
                "Sinhala",
                "Slovak",
                "Slovenian",
                "Sindhi",
                "Spanish",
                "Spanish (Old)",
                "Albanian",
                "Serbian (Cyrillic)",
                "Serbian (Latin)",
                "Sundanese",
                "Swahili",
                "Swedish",
                "Syriac",
                "Tamil",
                "Tatar",
                "Telugu",
                "Tajik",
                "Thai",
                "Tigrinya",
                "Tongan",
                "Turkish",
                "Uyghur",
                "Ukrainian",
                "Urdu",
                "Uzbek",
                "Uzbek (Cyrillic)",
                "Vietnamese",
                "Yiddish",
                "Yoruba"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "text",
              "chunks"
            ],
            "type": "string",
            "description": "Text: one dataset row per file with the full text and a list of pages (method, confidence, text). RAG chunks: one row per chunk with page numbers, ready for a vector database.",
            "default": "text"
          },
          "searchablePdf": {
            "title": "Create a searchable PDF",
            "type": "boolean",
            "description": "Save one PDF per file with an invisible text layer over the page images (select and search the text in any PDF viewer). The link is in searchablePdfUrl. No extra charge.",
            "default": false
          },
          "includeWords": {
            "title": "Include word boxes",
            "type": "boolean",
            "description": "Add every recognized word with its confidence (0-100) and position (left, top, width, height in pixels of the original image; for PDF pages, pixels at 300 DPI; measured after the page orientation is fixed) to each page. Makes the output much larger. Text format only.",
            "default": false
          },
          "datasetId": {
            "title": "Apify dataset with file links",
            "type": "string",
            "description": "OCR the files linked in an Apify dataset, e.g. the output of a scraper run with image or PDF URLs. One file per item, or every link of a list field (see URL column); the item's own fields come back in sourceRow so you can join the results. Up to 5,000 items and 5,000 files. In an integration that starts this Actor after another Actor's run, set it to {{resource.defaultDatasetId}}."
          },
          "fileUrl": {
            "title": "Spreadsheet URL (CSV, Excel, JSON or Google Sheet)",
            "type": "string",
            "description": "A public link to a CSV, Excel (.xlsx, first sheet), JSON or JSON Lines file with one file link per row, up to 5,000 rows. A Google Sheets link works when the sheet is shared as \"Anyone with the link\" (the first tab, or the tab in the link)."
          },
          "urlField": {
            "title": "URL column",
            "type": "string",
            "description": "The column (or dataset field) that holds the image or PDF link, e.g. imageUrl or receipt.url. A field that holds a list of links, e.g. images (all photos of a carousel post or a product) or childPosts.displayUrl, gives one result per link with urlIndex (its position in the list, 1 = first), up to 50 per row. Leave empty to use the column that holds the most http(s) links; list fields are guessed only when no column holds single links, so name a list field here."
          },
          "base64Files": {
            "title": "Files as base64",
            "type": "array",
            "description": "Send files inside the input instead of links, e.g. from an AI agent or a script: [{\"name\": \"receipt.jpg\", \"data\": \"<base64>\"}]. A data: URL works as data too. The whole input must stay under about 9 MB (about 6 MB of files); use links for bigger files."
          },
          "autoRotate": {
            "title": "Fix page orientation",
            "type": "boolean",
            "description": "Detect pages that are upside down or sideways and turn them before OCR.",
            "default": true
          },
          "ocrAllPages": {
            "title": "OCR pages that already have text",
            "type": "boolean",
            "description": "By default, PDF pages that already have a text layer are read directly (cheaper and exact). Turn on to OCR every page anyway, e.g. when the existing text layer is garbage.",
            "default": false
          },
          "maxPagesPerDocument": {
            "title": "Max pages per file",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Process only the first N pages of each PDF or multi-page TIFF. 0 = all (up to 500).",
            "default": 0
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum characters per chunk (RAG chunks only). Chunks break at paragraphs first, then lines and sentences.",
            "default": 2000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters repeated from the end of the previous chunk (RAG chunks only). At most half of the chunk size.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}