{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown – Bulk PDF Extractor with OCR",
    "description": "Extract text or clean Markdown (headings, lists, tables) from PDF URLs in bulk, or from every PDF linked on a web page. Metadata, page ranges, per-page or per-document output, OCR for scanned pages, RAG chunks. Full .md/.txt files saved to the key-value store.",
    "version": "0.1",
    "x-build-id": "iutxKdyGxnJ6gEAa7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-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/gazidev~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-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/gazidev~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. Google Drive / Dropbox share links, GitHub `blob` links and arXiv `/abs/` pages are converted to direct downloads automatically.",
            "default": [
              "https://arxiv.org/pdf/1706.03762",
              "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "pageUrls": {
            "title": "Web pages to scan for PDF links",
            "type": "array",
            "description": "Optional. The Actor loads each page (plain HTTP, no browser) and extracts every PDF it links to (links ending in `.pdf`, or matching `PDF link regex`). Great for report archives, documentation, investor-relations or government form pages.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPdfs": {
            "title": "Max PDFs",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many PDFs in total (direct URLs + PDFs found on pages). 0 = no limit.",
            "default": 50
          },
          "sameDomainOnly": {
            "title": "Only PDFs on the same domain as the page",
            "type": "boolean",
            "description": "When scanning web pages, skip PDF links that point to other domains.",
            "default": false
          },
          "pdfLinkRegex": {
            "title": "PDF link regex",
            "type": "string",
            "description": "Optional. When set, a link found on a scanned page is taken if its URL matches this regex (case-insensitive), even without a `.pdf` extension, e.g. `/download/|annual-report`."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "`markdown`: headings (`#`), lists, ruled tables as Markdown tables, paragraphs re-flowed - best for LLMs and RAG. `text`: plain text with the original line breaks, faster.",
            "default": "markdown"
          },
          "outputMode": {
            "title": "One dataset row per",
            "enum": [
              "document",
              "page",
              "chunk"
            ],
            "type": "string",
            "description": "`document`: one row per PDF with metadata and the full content. `page`: one row per page. `chunk`: one row per RAG chunk (uses `Chunk size`, default 1,500 characters). The price is the same in every mode (per page).",
            "default": "document"
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional. Pages to extract, e.g. `1-5`, `1,3,10-`, or `-3--1` for the last three pages. Empty = all pages (up to `Max pages per PDF`). Only extracted pages are charged."
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on pages extracted from one PDF (after the page range). 0 = no limit.",
            "default": 500
          },
          "removeHeadersFooters": {
            "title": "Remove running headers, footers and page numbers",
            "type": "boolean",
            "description": "Drops lines repeated at the top or bottom of many pages (journal names, 'Confidential', 'Page 3 of 10') and bare page numbers. Needs 3+ pages for repeated lines.",
            "default": true
          },
          "extractTables": {
            "title": "Markdown tables",
            "type": "boolean",
            "description": "Markdown format only: detect ruled tables (with drawn lines) and output them as Markdown tables. Tables without lines stay as text lines.",
            "default": true
          },
          "pageMarkers": {
            "title": "Insert page markers",
            "type": "boolean",
            "description": "Adds `<!-- page N -->` (Markdown) or `--- page N ---` (text) before each page in the document content and saved file.",
            "default": false
          },
          "maxCharsPerItem": {
            "title": "Max characters in the dataset content field",
            "minimum": 1000,
            "type": "integer",
            "description": "Longer content is cut in the dataset (`contentTruncated: true`). The complete text is always in the saved .md/.txt file (`contentFileUrl`).",
            "default": 100000
          },
          "saveToKeyValueStore": {
            "title": "Save full .md / .txt files",
            "type": "boolean",
            "description": "Save each PDF's full Markdown or text as a file in the run's key-value store, linked from every row (`contentFileUrl`).",
            "default": true
          },
          "ocrMode": {
            "title": "OCR mode",
            "enum": [
              "auto",
              "off",
              "force"
            ],
            "type": "string",
            "description": "`auto`: pages without a usable text layer (scans, photos, broken font encodings) are read with Tesseract OCR and charged as `ocr-page`; normal pages are not OCR'd. `off`: never OCR (scanned pages are reported, not charged). `force`: OCR every page.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages of the scanned text. Pick 1-3: more languages are slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "tur",
                "pol",
                "rus",
                "ukr",
                "ces",
                "swe",
                "ron",
                "ara",
                "hin",
                "chi_sim",
                "jpn",
                "kor",
                "ind",
                "vie"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Turkish",
                "Polish",
                "Russian",
                "Ukrainian",
                "Czech",
                "Swedish",
                "Romanian",
                "Arabic",
                "Hindi",
                "Chinese (simplified)",
                "Japanese",
                "Korean",
                "Indonesian",
                "Vietnamese"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "Rendering resolution for OCR. 300 is best for normal print; 200 is a little faster; 400 helps with very small text.",
            "default": 300
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Split each PDF into RAG-ready chunks of about this many characters, cut at paragraph, sentence or word boundaries, with page numbers and the section heading. 0 = no chunks (in `chunk` mode the default is 1,500). Chunks are free.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "type": "integer",
            "description": "Characters of the previous chunk repeated at the start of the next one (at most half the chunk size).",
            "default": 200
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Optional. Password for encrypted PDFs (used for all PDFs of the run). PDFs that only restrict printing/copying open without it."
          },
          "maxFileSizeMb": {
            "title": "Max PDF size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with an error row (free).",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout for one download. Failed downloads (timeouts, HTTP 429/5xx) are retried 3 times with backoff.",
            "default": 120
          },
          "maxConcurrentDownloads": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "PDFs downloaded in parallel while the previous ones are being extracted.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}