{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Image Text Extractor: OCR to Text & Markdown",
    "description": "Extract text and Markdown from PDFs and images (PNG, JPEG, TIFF, WebP, GIF, BMP, HEIC) by link. Uses a PDF's own text where it has some and Tesseract OCR for scans and photos, in 124 languages. One row per page with word counts and OCR confidence. Failed files and blank pages are free.",
    "version": "0.1",
    "x-build-id": "aFbPv0VaD7g7aYScS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subtleasianmerch~document-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subtleasianmerch-document-text-extractor",
        "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/subtleasianmerch~document-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-subtleasianmerch-document-text-extractor",
        "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/subtleasianmerch~document-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-subtleasianmerch-document-text-extractor",
        "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": {
          "fileUrls": {
            "title": "File links",
            "type": "array",
            "description": "Direct links to PDFs and images, one per line: PDF, PNG, JPEG, TIFF (all its pages), WebP, GIF, BMP, HEIC/HEIF, AVIF or JPEG 2000. The link must download the file itself, e.g. https://example.com/report.pdf: your own server, a public or signed S3 or Google Cloud Storage link, a Dropbox or Google Drive share link (changed to its download link for you), or a record in Apify storage. Files up to 200 MB.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Or upload files",
            "type": "array",
            "description": "Optional. Files from your computer, stored in one of your Apify key-value stores and read from there. Read together with the links above."
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Optional. Which pages of each PDF (and multi-page TIFF) to read, e.g. 1-5, 8, 10- (from page 10 to the end). Empty reads every page. Single images are always read."
          },
          "maxPagesPerFile": {
            "title": "Most pages per file",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "No file gives more pages than this; the rest aren't read and cost nothing.",
            "default": 500
          },
          "maxPagesPerRun": {
            "title": "Most pages per run",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Optional. The run stops after this many pages with text in all. It also stops cleanly at your maximum cost per run."
          },
          "ocrMode": {
            "title": "OCR",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Automatic: a PDF page's own (embedded) text is used where it has some; scanned pages, pages without usable text, and images are read with OCR (Tesseract). Always: every PDF page is read with OCR, ignoring its embedded text (for PDFs whose text is garbled). Never: only embedded text; pages without it, and images, give no text (free).",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "The languages in your documents, for OCR (up to 5; each one makes OCR slower). Choose all that appear, e.g. English and French for a bilingual form. 18 common languages are installed; the others (Chinese, Japanese, Arabic, Hindi and 102 more) are downloaded from Tesseract's official models when a run uses them, which adds a few seconds.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "ces",
                "dan",
                "nld",
                "fin",
                "fra",
                "deu",
                "hun",
                "ita",
                "nor",
                "pol",
                "por",
                "ron",
                "rus",
                "spa",
                "swe",
                "tur",
                "ukr",
                "afr",
                "sqi",
                "amh",
                "grc",
                "ara",
                "hye",
                "asm",
                "aze",
                "aze_cyrl",
                "eus",
                "bel",
                "ben",
                "bos",
                "bre",
                "bul",
                "mya",
                "cat",
                "ceb",
                "chr",
                "chi_sim_vert",
                "chi_sim",
                "chi_tra_vert",
                "chi_tra",
                "cos",
                "hrv",
                "div",
                "dzo",
                "epo",
                "est",
                "fao",
                "fil",
                "glg",
                "kat",
                "kat_old",
                "deu_latf",
                "ell",
                "guj",
                "hat",
                "heb",
                "hin",
                "isl",
                "ind",
                "iku",
                "gle",
                "ita_old",
                "jpn",
                "jpn_vert",
                "jav",
                "kan",
                "kaz",
                "khm",
                "kor",
                "kor_vert",
                "kmr",
                "kir",
                "lao",
                "lat",
                "lav",
                "lit",
                "ltz",
                "mkd",
                "msa",
                "mal",
                "mlt",
                "mri",
                "mar",
                "equ",
                "enm",
                "frm",
                "mon",
                "nep",
                "oci",
                "ori",
                "pus",
                "fas",
                "pan",
                "que",
                "san",
                "gla",
                "srp",
                "srp_latn",
                "snd",
                "sin",
                "slk",
                "slv",
                "spa_old",
                "sun",
                "swa",
                "syr",
                "tgk",
                "tam",
                "tat",
                "tel",
                "tha",
                "bod",
                "tir",
                "ton",
                "urd",
                "uig",
                "uzb",
                "uzb_cyrl",
                "vie",
                "cym",
                "fry",
                "yid",
                "yor"
              ],
              "enumTitles": [
                "English",
                "Czech",
                "Danish",
                "Dutch",
                "Finnish",
                "French",
                "German",
                "Hungarian",
                "Italian",
                "Norwegian",
                "Polish",
                "Portuguese",
                "Romanian",
                "Russian",
                "Spanish",
                "Swedish",
                "Turkish",
                "Ukrainian",
                "Afrikaans",
                "Albanian",
                "Amharic",
                "Ancient Greek",
                "Arabic",
                "Armenian",
                "Assamese",
                "Azerbaijani",
                "Azerbaijani (Cyrillic)",
                "Basque",
                "Belarusian",
                "Bengali",
                "Bosnian",
                "Breton",
                "Bulgarian",
                "Burmese",
                "Catalan",
                "Cebuano",
                "Cherokee",
                "Chinese (Simplified, vertical)",
                "Chinese (Simplified)",
                "Chinese (Traditional, vertical)",
                "Chinese (Traditional)",
                "Corsican",
                "Croatian",
                "Dhivehi",
                "Dzongkha",
                "Esperanto",
                "Estonian",
                "Faroese",
                "Filipino",
                "Galician",
                "Georgian",
                "Georgian (old)",
                "German (Fraktur)",
                "Greek",
                "Gujarati",
                "Haitian Creole",
                "Hebrew",
                "Hindi",
                "Icelandic",
                "Indonesian",
                "Inuktitut",
                "Irish",
                "Italian (old)",
                "Japanese",
                "Japanese (vertical)",
                "Javanese",
                "Kannada",
                "Kazakh",
                "Khmer",
                "Korean",
                "Korean (vertical)",
                "Kurdish (Kurmanji)",
                "Kyrgyz",
                "Lao",
                "Latin",
                "Latvian",
                "Lithuanian",
                "Luxembourgish",
                "Macedonian",
                "Malay",
                "Malayalam",
                "Maltese",
                "Maori",
                "Marathi",
                "Math equations",
                "Middle English",
                "Middle French",
                "Mongolian",
                "Nepali",
                "Occitan",
                "Odia",
                "Pashto",
                "Persian",
                "Punjabi",
                "Quechua",
                "Sanskrit",
                "Scottish Gaelic",
                "Serbian (Cyrillic)",
                "Serbian (Latin)",
                "Sindhi",
                "Sinhala",
                "Slovak",
                "Slovenian",
                "Spanish (old)",
                "Sundanese",
                "Swahili",
                "Syriac",
                "Tajik",
                "Tamil",
                "Tatar",
                "Telugu",
                "Thai",
                "Tibetan",
                "Tigrinya",
                "Tongan",
                "Urdu",
                "Uyghur",
                "Uzbek",
                "Uzbek (Cyrillic)",
                "Vietnamese",
                "Welsh",
                "Western Frisian",
                "Yiddish",
                "Yoruba"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrLayout": {
            "title": "OCR page layout",
            "enum": [
              "auto",
              "column",
              "block",
              "sparse"
            ],
            "type": "string",
            "description": "How Tesseract finds the text on a page. Automatic suits most documents, including several columns. Single column reads the page as one column of text. Single block treats the page as one block (receipts, labels, cropped text). Sparse finds as much scattered text as it can, in no particular order (forms, diagrams, screenshots).",
            "default": "auto"
          },
          "ocrDpi": {
            "title": "OCR resolution for PDF pages",
            "minimum": 100,
            "maximum": 600,
            "type": "integer",
            "description": "PDF pages are turned into images at this resolution for OCR. 300 suits most documents; 400 can help with very small print, and is slower. Images are read at their own resolution.",
            "default": 300
          },
          "markdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Also give each page as simple Markdown: paragraphs, headings (text clearly larger than the body text) and lists. Tables come out as plain lines.",
            "default": true
          },
          "fileRows": {
            "title": "One row per file too",
            "type": "boolean",
            "description": "Also add one row per file with all its text and Markdown, its page counts and the PDF's title, author and dates, and save the whole text as .txt and .md files in the run's storage. These rows are free.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}