{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & OCR - Scanned PDFs, Images, Word, Japanese",
    "description": "PDF to text and OCR: extract text from PDFs, scanned PDFs, images (PNG, JPEG, WebP) and Word by link, upload or key-value store. Scans and photos go through AI OCR. Lines joined, headers and page numbers removed, Japanese-ready. $0.003 per 20 text pages, $0.004 per OCR page + AI cost.",
    "version": "0.2",
    "x-build-id": "uq4ioQp6463EWUvyS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quietworkslab~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quietworkslab-pdf-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/quietworkslab~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-quietworkslab-pdf-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/quietworkslab~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-quietworkslab-pdf-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 PDF, DOCX, PNG, JPEG or WebP files (not web pages); use only files you have the right to use. A run takes up to 100 links, read one at a time after the store and the uploads. A link that fails is not charged. Leave empty (with no store and no uploads) to try the Actor on built-in sample files.",
            "items": {
              "type": "string"
            }
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "Optional. A key-value store in your account that holds PDF, DOCX or image files. Every record that is a PDF or DOCX is read, and with OCR on (the default) every PNG, JPEG or WebP image too; JSON and other records are skipped. When this Actor runs after another Actor from its Integrations tab, set it to {{resource.defaultKeyValueStoreId}}. Uploaded files that are in this store are read with it, once."
          },
          "keyPrefix": {
            "title": "Only keys starting with",
            "type": "string",
            "description": "Optional. Read only the records of the key-value store whose key starts with this text, for example invoice- or 2026-11-. Empty = all records."
          },
          "uploadedFiles": {
            "title": "Upload files",
            "type": "array",
            "description": "Optional. Upload PDF or DOCX files (up to 100 MB each) or PNG, JPEG or WebP images (up to 25 MB) here. This field takes only files stored in your Apify account; put links to files on other websites into \"File links\". If your account keeps its storages private (the default), the run names the store your uploads are in: choose that store in \"Key-value store\" and start again."
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Optional. Which pages of each PDF to read, for example 1-5,10 or 20- (from page 20 to the end). Empty = all pages (up to 2,000 per file). Only the pages read that have text are counted. DOCX files have no pages and are read whole."
          },
          "splitBy": {
            "title": "One row per",
            "enum": [
              "document",
              "page"
            ],
            "type": "string",
            "description": "Document: one dataset row per file. Page: one row per PDF page (handy for search and RAG); a DOCX file is still one row. The rows have the same fields either way.",
            "default": "document"
          },
          "lineJoin": {
            "title": "Line breaks",
            "enum": [
              "smart",
              "keep"
            ],
            "type": "string",
            "description": "Join wrapped lines into paragraphs (default): lines that the layout wrapped are joined, with no space between Japanese characters, and an English word split by a hyphen at the end of a line is mended; OCR text the same way (table rows, list items and headings stay on their own lines). Keep: every line stays a line, as on the page.",
            "default": "smart"
          },
          "removeHeadersFooters": {
            "title": "Remove headers, footers and page numbers",
            "type": "boolean",
            "description": "Checked (default): at the top or bottom of a page, page numbers are removed (a bare number only when it goes up with the page; documents of 2 pages or more), and so is a line that differs only in a number that goes up with the page on at least half of the pages; a line that is exactly the same on at least half of the pages (documents of 3 pages or more) stays on the first page where it appears and is removed from the others. Headings in a bigger font, sentences and amounts that differ by page stay. The count is in removedLines.",
            "default": true
          },
          "normalize": {
            "title": "Character clean-up",
            "enum": [
              "basic",
              "japanese",
              "none"
            ],
            "type": "string",
            "description": "Basic: invisible and control characters removed, spaces tidied, Unicode NFC. Japanese: also full-width letters and digits to ASCII, half-width katakana to full width, dashes and long vowels fixed (the same clean-up as Japanese Text Normalizer by Quiet Works Lab). None: the text as extracted.",
            "default": "basic"
          },
          "outputFormat": {
            "title": "Text format",
            "enum": [
              "text",
              "markdown"
            ],
            "type": "string",
            "description": "Plain text: paragraphs separated by an empty line. Markdown: a simple version; PDF headings are guessed from a bigger font size, DOCX headings, lists and tables come from the document.",
            "default": "text"
          },
          "maxFiles": {
            "title": "Maximum number of files",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. Stop after this many files (extracted, without text, or failed), for example to try the settings on 5 files first. Empty = no limit."
          },
          "ocr": {
            "title": "OCR (scanned pages and images)",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "type": "string",
            "description": "Auto (default): pages of a PDF without a usable text layer (a scan, a garbled font, or mostly empty pages) and images are read by an AI model (Google Gemini 3.1 Flash-Lite through Apify's apify/openrouter Actor); the other pages keep their text layer. Always: every PDF page is read by the AI. Off: version 0.1 behaviour, scans are flagged and not charged, and nothing is sent to any AI. One page-ocr event per OCR page with text; the AI model is billed separately to your Apify account by apify/openrouter at its own price. DOCX files are never OCR'd.",
            "default": "auto"
          },
          "maxOcrPages": {
            "title": "Maximum OCR pages per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Optional. The most OCR pages sent to the AI in one run: a PDF page or an image up to about 2,000 x 2,800 pixels is one, a long screenshot is cut into several. The rest is not OCR'd and the rows say so. Empty = 200 on a paid Apify plan, 20 on the Free plan (where the AI costs 10 times more). Resends never pass twice this number. Your maximum cost per run limits this Actor's events only, not the AI bill, so this cap is what limits the AI cost."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}