{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor",
    "description": "PDF Text Extractor SD - PDF Text Extractor is a document data tool that extracts text, Markdown, tables, metadata and OCR text from PDF files by URL or Base64: page by page, with page ranges, passwords and RAG-ready chunks for LLMs.",
    "version": "1.0",
    "x-build-id": "hGkuhj0Skkz22P4Do"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neuro-scraper~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neuro-scraper-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/neuro-scraper~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-neuro-scraper-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/neuro-scraper~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-neuro-scraper-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": "Links to PDF files, one per line (https://arxiv.org/pdf/1706.03762). Redirects are followed.",
            "items": {
              "type": "string"
            }
          },
          "base64Pdfs": {
            "title": "Base64 PDFs (for API calls)",
            "type": "array",
            "description": "Optional: PDFs as Base64 strings, or objects {\"fileName\": \"a.pdf\", \"data\": \"<base64>\"}."
          },
          "documentFile": {
            "title": "Upload a PDF",
            "type": "string",
            "description": "Upload one PDF from your computer (Apify Console file upload); it is read like a PDF URL."
          },
          "data": {
            "title": "Rows with PDF links (from another dataset)",
            "type": "array",
            "description": "Rows of another dataset, e.g. [{\"url\": \"https://.../a.pdf\", \"client\": \"ACME\"}]. The PDF link is read from url / pdfUrl / fileUrl / link (else the first http(s) value); with Keep original fields the whole row is copied into originalFields."
          },
          "keepOriginalFields": {
            "title": "Keep original fields of data rows",
            "type": "boolean",
            "description": "Copy each data row into the originalFields column of its result row.",
            "default": true
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional: pages to read, e.g. 1-3,7,10- (empty = all pages)."
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF (after the page range).",
            "default": 500
          },
          "includeFullText": {
            "title": "Full text",
            "type": "boolean",
            "description": "Save the whole document text in the text field.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Markdown (LLM / RAG ready)",
            "type": "boolean",
            "description": "Save the document as Markdown: a heading per page, paragraphs and tables as Markdown tables.",
            "default": true
          },
          "includePages": {
            "title": "Per-page text",
            "type": "boolean",
            "description": "Save a list with the text, word count and OCR flag of every page.",
            "default": false
          },
          "outputFormat": {
            "title": "Output format preset",
            "enum": [
              "markdown",
              "per_page",
              "combined",
              "both",
              "rag_chunks"
            ],
            "type": "string",
            "description": "Optional one switch for the output shape. Not set = the Full text / Markdown / Per-page / RAG chunk toggles decide."
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Detect tables and save them as rows of cells (and inside the Markdown).",
            "default": false
          },
          "ocrScannedPages": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Read pages without a text layer (scans, images) with OCR.",
            "default": true
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "eng",
              "deu",
              "fra",
              "spa",
              "ita",
              "por",
              "nld",
              "pol"
            ],
            "type": "string",
            "description": "Language of the scanned text.",
            "default": "eng"
          },
          "ocrMaxPagesPerPdf": {
            "title": "Max OCR pages per PDF",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "OCR is slow (seconds per page): read at most this many scanned pages per PDF.",
            "default": 50
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 72,
            "maximum": 600,
            "type": "integer",
            "description": "Resolution at which scanned pages are rendered for OCR. Higher = small print is read better, but slower.",
            "default": 200
          },
          "minWordConfidence": {
            "title": "OCR minimum word confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop OCR words recognised with a confidence below this value (0-100). 0 = keep everything.",
            "default": 0
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "Optional: the password of protected PDFs (the same for all files of the run)."
          },
          "removePageNumbers": {
            "title": "Remove page number lines",
            "type": "boolean",
            "description": "Drop lines that only hold a page number (12, Page 3, 4 / 20).",
            "default": false
          },
          "removeHeaderFooter": {
            "title": "Remove repeated headers and footers",
            "type": "boolean",
            "description": "Removes lines that repeat at the top or bottom of most pages (running titles, \"Confidential\", \"Page 3 of 10\") from text, Markdown, pages and chunks.",
            "default": false
          },
          "removeExcessBlankLines": {
            "title": "Remove excess blank lines",
            "type": "boolean",
            "description": "Collapses runs of empty lines to one blank line and strips trailing spaces.",
            "default": false
          },
          "skipEmptyPages": {
            "title": "Skip empty pages",
            "type": "boolean",
            "description": "Leave out pages with no text.",
            "default": false
          },
          "chunkForRag": {
            "title": "Split into RAG chunks",
            "type": "boolean",
            "description": "Also save the text split into overlapping chunks for embeddings and retrieval.",
            "default": false
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Length of one chunk.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters shared by neighbouring chunks.",
            "default": 150
          },
          "autoSummarize": {
            "title": "Add a summary",
            "type": "boolean",
            "description": "Adds summary: the most representative sentences of the document (extractive - taken from the text itself, in document order).",
            "default": false
          },
          "summarySentences": {
            "title": "Summary length (sentences)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many sentences the summary has.",
            "default": 5
          },
          "statementLedger": {
            "title": "Read statement transactions (ledger)",
            "type": "boolean",
            "description": "For bank / card statements: adds ledger - one entry per transaction line (date, description, amount, debit, credit, balance, page) - and ledgerCount.",
            "default": false
          },
          "changeDetection": {
            "title": "Change detection",
            "type": "boolean",
            "description": "Remember a fingerprint of each document between runs and add contentHash, previousContentHash and changed (true = new or changed since the last run).",
            "default": false
          },
          "changedOnly": {
            "title": "Only changed documents",
            "type": "boolean",
            "description": "With change detection: skip documents whose text is the same as in the last run (no row, no charge).",
            "default": false
          },
          "changeStoreName": {
            "title": "Change memory name",
            "type": "string",
            "description": "Name of the memory used by change detection (one per monitored list).",
            "default": "pdf-text-changes"
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with an error row.",
            "default": 50
          },
          "timeoutPerPdfSecs": {
            "title": "Timeout per PDF (seconds)",
            "minimum": 10,
            "maximum": 1800,
            "type": "integer",
            "description": "Download time limit per file.",
            "default": 120
          },
          "maxConcurrency": {
            "title": "PDFs in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs are processed at the same time.",
            "default": 3
          },
          "maxItems": {
            "title": "Max PDFs",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many PDFs (rows) to save in total.",
            "default": 100
          },
          "keep": {
            "title": "Keep rows",
            "enum": [
              "all",
              "with_text",
              "no_text",
              "problems"
            ],
            "type": "string",
            "description": "Which result rows are saved. Left-out rows cost nothing.",
            "default": "all"
          },
          "outputDatasetName": {
            "title": "Also save to dataset (name)",
            "type": "string",
            "description": "Optional: also append every row to this named dataset of your account (it collects rows across runs)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy for downloads from websites that block data centers (residential works best). Off by default: most PDF links download directly.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}