{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor — Markdown, OCR & Metadata",
    "description": "Turn any PDF URL into clean data: full text, LLM-ready Markdown, per-page content, and metadata. Reads scanned PDFs via OCR (23 languages), supports page ranges, and processes files in parallel. Export JSON, CSV, or Excel. Ideal for RAG pipelines, invoices, and research.",
    "version": "0.0",
    "x-build-id": "YgKTAK8YWC0brppev"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-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/memo23~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-memo23-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/memo23~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-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": {
          "urls": {
            "title": "📄 PDF URLs",
            "type": "array",
            "description": "Direct URLs to PDF files. Each URL must point to a downloadable PDF document (redirects are followed).",
            "items": {
              "type": "string"
            }
          },
          "pdfFile": {
            "title": "📎 Upload a PDF file",
            "type": "string",
            "description": "Upload a single PDF file directly from your computer."
          },
          "base64Pdfs": {
            "title": "🧬 Base64 PDFs (for API calls)",
            "type": "array",
            "description": "Base64-encoded PDFs, each either a plain base64 string (data-URI prefix allowed) or an object <code>{\"filename\": \"doc.pdf\", \"data\": \"…\"}</code>."
          },
          "pdfPassword": {
            "title": "🔑 PDF password",
            "type": "string",
            "description": "Password for opening protected PDFs. Applied to every document in the run that needs one."
          },
          "pageRange": {
            "title": "📑 Page range",
            "type": "string",
            "description": "Extract only these pages, e.g. <code>1-5, 8, 12-</code> (<code>12-</code> = page 12 to the end). Leave empty to extract all pages. Applies to every PDF in the run."
          },
          "includeFullText": {
            "title": "Full text",
            "type": "boolean",
            "description": "Include the complete plain text of the document in the <code>text</code> field.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Markdown (LLM/RAG-ready)",
            "type": "boolean",
            "description": "Include a Markdown rendition in the <code>markdown</code> field — headings, paragraphs, and bullet lists are reconstructed from the PDF layout. Ideal for feeding LLMs, embeddings, and RAG pipelines.",
            "default": true
          },
          "includePerPageText": {
            "title": "Per-page text",
            "type": "boolean",
            "description": "Include a <code>pages</code> array with the text of each individual page. Disable to keep output rows small for large PDFs.",
            "default": false
          },
          "ocrScannedPages": {
            "title": "🔍 OCR scanned pages",
            "type": "boolean",
            "description": "When a page has no usable text layer (scanned/image-only PDFs), render it and run OCR to recover the text. Slower and billed per OCR page — only pages that actually need it are OCRed.",
            "default": false
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "eng",
              "deu",
              "fra",
              "spa",
              "ita",
              "por",
              "nld",
              "pol",
              "ces",
              "swe",
              "dan",
              "nor",
              "fin",
              "tur",
              "rus",
              "ukr",
              "ara",
              "heb",
              "hin",
              "jpn",
              "kor",
              "chi_sim",
              "chi_tra"
            ],
            "type": "string",
            "description": "Language of the scanned documents, used by the OCR engine.",
            "default": "eng"
          },
          "maxConcurrency": {
            "title": "⚡ Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to download and process in parallel. Higher is faster but uses more memory.",
            "default": 5
          },
          "timeoutPerPdfSecs": {
            "title": "⏱️ Timeout per PDF (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum time to wait for each PDF download. Raise it for very large files or slow hosts.",
            "default": 90
          },
          "maxPdfSizeMb": {
            "title": "📦 Max PDF size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "PDFs larger than this are skipped (reported as failed rows) to protect memory.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy for downloads",
            "type": "object",
            "description": "Blocked downloads (401/403/407/429) automatically retry through a proxy — no setup needed. Set this only to force EVERY download through the proxy, e.g. for geo-restricted hosts."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}