{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor with OCR, Tables & Markdown",
    "description": "Extract text, tables and metadata from any PDF, digital or scanned. Built-in OCR in 124 languages reads scanned pages automatically. Get Markdown for AI and RAG, tables as CSV, filled form fields and per-page results. USD 0.30 per 1,000 text pages, USD 3 per 1,000 OCR pages.",
    "version": "0.1",
    "x-build-id": "bA7jfjjZLjCUdKAzc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/usefulapi~pdf-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-usefulapi-pdf-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/usefulapi~pdf-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-usefulapi-pdf-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/usefulapi~pdf-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-usefulapi-pdf-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": {
          "startUrls": {
            "title": "PDF or image URLs",
            "type": "array",
            "description": "Direct links to PDF files or images (PNG, JPEG, TIFF, WebP, GIF, BMP). Google Drive and Dropbox share links work when the file is public. You can also give a text file of links (one per line).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "files": {
            "title": "Upload files",
            "type": "array",
            "description": "Upload PDFs or images from your computer (they go to a key-value store on your account)."
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Auto reads scanned pages with OCR and every other page from its exact text layer. Always reads every page with OCR (also text in pictures; every page is then billed as an OCR page). Never skips OCR. Images are always read with OCR.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages printed on the scans, up to 3 (first = main language). 124 languages; pick only the ones you need, more languages make OCR slower and less accurate. Chinese, Japanese and Korean pages count as 2 OCR pages; for vertical print pick the \"vertical\" models.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "afr",
                "sqi",
                "amh",
                "ara",
                "hye",
                "asm",
                "aze",
                "aze_cyrl",
                "eus",
                "bel",
                "ben",
                "bos",
                "bre",
                "bul",
                "mya",
                "cat",
                "ceb",
                "chr",
                "chi_sim",
                "chi_sim_vert",
                "chi_tra",
                "chi_tra_vert",
                "cos",
                "hrv",
                "ces",
                "dan",
                "div",
                "nld",
                "dzo",
                "enm",
                "epo",
                "est",
                "fao",
                "fil",
                "fin",
                "frk",
                "fra",
                "frm",
                "fry",
                "glg",
                "kat",
                "kat_old",
                "deu",
                "deu_latf",
                "ell",
                "grc",
                "guj",
                "hat",
                "heb",
                "hin",
                "hun",
                "isl",
                "ind",
                "iku",
                "gle",
                "ita",
                "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",
                "mon",
                "nep",
                "nor",
                "oci",
                "ori",
                "pus",
                "fas",
                "pol",
                "por",
                "pan",
                "que",
                "ron",
                "rus",
                "san",
                "gla",
                "srp",
                "srp_latn",
                "snd",
                "sin",
                "slk",
                "slv",
                "spa",
                "spa_old",
                "sun",
                "swa",
                "swe",
                "syr",
                "tgk",
                "tam",
                "tat",
                "tel",
                "tha",
                "bod",
                "tir",
                "ton",
                "tur",
                "ukr",
                "urd",
                "uig",
                "uzb",
                "uzb_cyrl",
                "vie",
                "cym",
                "yid",
                "yor"
              ],
              "enumTitles": [
                "English (eng)",
                "Afrikaans (afr)",
                "Albanian (sqi)",
                "Amharic (amh)",
                "Arabic (ara)",
                "Armenian (hye)",
                "Assamese (asm)",
                "Azerbaijani (aze)",
                "Azerbaijani (Cyrillic) (aze_cyrl)",
                "Basque (eus)",
                "Belarusian (bel)",
                "Bengali (ben)",
                "Bosnian (bos)",
                "Breton (bre)",
                "Bulgarian (bul)",
                "Burmese (mya)",
                "Catalan (cat)",
                "Cebuano (ceb)",
                "Cherokee (chr)",
                "Chinese (Simplified) (chi_sim)",
                "Chinese (Simplified, vertical) (chi_sim_vert)",
                "Chinese (Traditional) (chi_tra)",
                "Chinese (Traditional, vertical) (chi_tra_vert)",
                "Corsican (cos)",
                "Croatian (hrv)",
                "Czech (ces)",
                "Danish (dan)",
                "Dhivehi (div)",
                "Dutch (nld)",
                "Dzongkha (dzo)",
                "English (Middle, 1100-1500) (enm)",
                "Esperanto (epo)",
                "Estonian (est)",
                "Faroese (fao)",
                "Filipino (fil)",
                "Finnish (fin)",
                "Frankish (frk)",
                "French (fra)",
                "French (Middle, 1400-1600) (frm)",
                "Frisian (Western) (fry)",
                "Galician (glg)",
                "Georgian (kat)",
                "Georgian (Old) (kat_old)",
                "German (deu)",
                "German (Fraktur) (deu_latf)",
                "Greek (ell)",
                "Greek (Ancient) (grc)",
                "Gujarati (guj)",
                "Haitian Creole (hat)",
                "Hebrew (heb)",
                "Hindi (hin)",
                "Hungarian (hun)",
                "Icelandic (isl)",
                "Indonesian (ind)",
                "Inuktitut (iku)",
                "Irish (gle)",
                "Italian (ita)",
                "Italian (Old) (ita_old)",
                "Japanese (jpn)",
                "Japanese (vertical) (jpn_vert)",
                "Javanese (jav)",
                "Kannada (kan)",
                "Kazakh (kaz)",
                "Khmer (khm)",
                "Korean (kor)",
                "Korean (vertical) (kor_vert)",
                "Kurdish (Kurmanji) (kmr)",
                "Kyrgyz (kir)",
                "Lao (lao)",
                "Latin (lat)",
                "Latvian (lav)",
                "Lithuanian (lit)",
                "Luxembourgish (ltz)",
                "Macedonian (mkd)",
                "Malay (msa)",
                "Malayalam (mal)",
                "Maltese (mlt)",
                "Maori (mri)",
                "Marathi (mar)",
                "Mongolian (mon)",
                "Nepali (nep)",
                "Norwegian (nor)",
                "Occitan (oci)",
                "Odia (ori)",
                "Pashto (pus)",
                "Persian (fas)",
                "Polish (pol)",
                "Portuguese (por)",
                "Punjabi (pan)",
                "Quechua (que)",
                "Romanian (ron)",
                "Russian (rus)",
                "Sanskrit (san)",
                "Scottish Gaelic (gla)",
                "Serbian (Cyrillic) (srp)",
                "Serbian (Latin) (srp_latn)",
                "Sindhi (snd)",
                "Sinhala (sin)",
                "Slovak (slk)",
                "Slovenian (slv)",
                "Spanish (spa)",
                "Spanish (Old) (spa_old)",
                "Sundanese (sun)",
                "Swahili (swa)",
                "Swedish (swe)",
                "Syriac (syr)",
                "Tajik (tgk)",
                "Tamil (tam)",
                "Tatar (tat)",
                "Telugu (tel)",
                "Thai (tha)",
                "Tibetan (bod)",
                "Tigrinya (tir)",
                "Tongan (ton)",
                "Turkish (tur)",
                "Ukrainian (ukr)",
                "Urdu (urd)",
                "Uyghur (uig)",
                "Uzbek (uzb)",
                "Uzbek (Cyrillic) (uzb_cyrl)",
                "Vietnamese (vie)",
                "Welsh (cym)",
                "Yiddish (yid)",
                "Yoruba (yor)"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 150,
            "maximum": 400,
            "type": "integer",
            "description": "300 suits normal print. Use 400 for very small print (US Legal pages then count as 2 OCR pages); 200 for large print (faster).",
            "default": 300
          },
          "tables": {
            "title": "Tables",
            "enum": [
              "lines",
              "text",
              "off"
            ],
            "type": "string",
            "description": "Ruled tables finds tables with drawn cell borders. Ruled and aligned (experimental) also looks for tables lined up by spaces only; it skips anything that looks like a paragraph but can still miss or split such tables.",
            "default": "lines"
          },
          "markdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Also return Markdown: headings from font sizes, lists, tables as Markdown tables. Good for AI and RAG pipelines.",
            "default": true
          },
          "layoutText": {
            "title": "Text with the page layout kept",
            "type": "boolean",
            "description": "Also return text placed as on the page (columns side by side, padded with spaces). Useful for forms and reports.",
            "default": false
          },
          "outputMode": {
            "title": "One row per",
            "enum": [
              "document",
              "page"
            ],
            "type": "string",
            "description": "Document: one row per file with all its pages. Page: one row per page.",
            "default": "document"
          },
          "pageRange": {
            "title": "Pages to read",
            "type": "string",
            "description": "For example \"1-5, 8, 10-\". Empty = every page."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Pages read per file at most (after \"Pages to read\"). Up to 5,000.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with a clear message. Up to 500 MB.",
            "default": 100
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "For password-protected PDFs (used for every file in this run)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}