{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown & Clean Text Extractor (RAG Ready + MCP)",
    "description": "Extract clean structured Markdown, two-column reading order, clickable hyperlinks, TOC bookmarks, metadata, and RAG chunks from PDFs with cloud-link auto-rewriting and Standby MCP.",
    "version": "1.0",
    "x-build-id": "FBI3eN1J3Rf0yle8B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgekit~pdf-to-markdown-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgekit-pdf-to-markdown-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/forgekit~pdf-to-markdown-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-forgekit-pdf-to-markdown-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/forgekit~pdf-to-markdown-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-forgekit-pdf-to-markdown-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",
            "maxItems": 500,
            "type": "array",
            "description": "Public PDF URLs to download and parse (SSRF-protected). Supports Google Drive, Dropbox, and OneDrive share links when normalizeCloudPdfUrl is enabled.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "normalizeCloudPdfUrl": {
            "title": "Normalize Cloud Share PDF URLs",
            "type": "boolean",
            "description": "Automatically convert public Google Drive, Dropbox (dl=0 to dl=1), and OneDrive share links into direct binary PDF download URLs.",
            "default": true
          },
          "base64Pdfs": {
            "title": "Inline Base64 PDFs",
            "maxItems": 50,
            "type": "array",
            "description": "Inline PDF payloads as objects [{ \"filename\": \"report.pdf\", \"dataBase64\": \"JVBERi0x...\" }] for zero-URL offline and MCP workflows.",
            "default": []
          },
          "kvsKeys": {
            "title": "Key-Value Store Keys",
            "maxItems": 200,
            "type": "array",
            "description": "Keys of binary PDF records stored in the Actor's Key-Value Store (or sourceStoreId).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sourceStoreId": {
            "title": "Source Storage ID",
            "maxLength": 128,
            "type": "string",
            "description": "Optional external Apify Key-Value Store ID to read kvsKeys from (defaults to the run's default store).",
            "default": ""
          },
          "inputDatasetId": {
            "title": "Input Dataset ID",
            "maxLength": 128,
            "type": "string",
            "description": "Optional Apify Dataset ID from which to read PDF URLs.",
            "default": ""
          },
          "datasetUrlField": {
            "title": "Dataset URL Field",
            "maxLength": 128,
            "type": "string",
            "description": "Field name containing the PDF URL inside each row of inputDatasetId.",
            "default": "url"
          },
          "password": {
            "title": "PDF Password",
            "type": "string",
            "description": "Optional decryption password for encrypted PDF files."
          },
          "pageRange": {
            "title": "Page Range",
            "maxLength": 128,
            "type": "string",
            "description": "1-indexed page selection such as \"1-5,8,10-12\". Leave empty to extract all pages up to maxPages.",
            "default": ""
          },
          "maxPages": {
            "title": "Max Pages Per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Safety upper cap on pages extracted per PDF.",
            "default": 250
          },
          "includeMarkdown": {
            "title": "Include Structured Markdown",
            "type": "boolean",
            "description": "Reconstruct headings, lists, and clickable links in clean Markdown.",
            "default": true
          },
          "includeFullText": {
            "title": "Include Plain Full Text",
            "type": "boolean",
            "description": "Include clean plain-text concatenation across extracted pages.",
            "default": true
          },
          "includePerPageText": {
            "title": "Include Per-Page Breakdown",
            "type": "boolean",
            "description": "Include per-page text, Markdown, word counts, and scanned-page flags.",
            "default": true
          },
          "extractLinksAndOutline": {
            "title": "Extract Hyperlinks & TOC Outline",
            "type": "boolean",
            "description": "Extract native PDF outline/bookmark tree and embedded hyperlink annotations.",
            "default": true
          },
          "removeHeadersFooters": {
            "title": "Strip Repeated Headers & Footers",
            "type": "boolean",
            "description": "Detect and strip repeated running top/bottom margin lines appearing on >= 60% of pages.",
            "default": true
          },
          "removePageNumbers": {
            "title": "Strip Standalone Page Numbers",
            "type": "boolean",
            "description": "Remove standalone margin page counters such as \"Page 3 of 10\" or \"- 3 -\".",
            "default": true
          },
          "preserveColumnOrder": {
            "title": "Preserve Two-Column Reading Order",
            "type": "boolean",
            "description": "Detect vertical two-column gutters and order left column before right column.",
            "default": true
          },
          "minTextCharsPerPage": {
            "title": "Min Text Chars Per Page (Scanned Detection)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Pages with fewer non-whitespace characters than this threshold are flagged as likely scanned.",
            "default": 25
          },
          "ocrScannedPages": {
            "title": "Run Local OCR Fallback on Scanned Pages",
            "type": "boolean",
            "description": "Optionally run local tesseract.js OCR on embedded images of scanned pages.",
            "default": false
          },
          "chunkForRag": {
            "title": "Chunk Output for RAG / Vector DBs",
            "type": "boolean",
            "description": "Emit overlapping text chunks sized by chunkSizeChars and chunkOverlapChars.",
            "default": false
          },
          "chunkSizeChars": {
            "title": "RAG Chunk Size (Characters)",
            "minimum": 200,
            "maximum": 16000,
            "type": "integer",
            "description": "Target maximum character length per RAG chunk.",
            "default": 1500
          },
          "chunkOverlapChars": {
            "title": "RAG Chunk Overlap (Characters)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "Overlap in characters between consecutive RAG chunks.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max Concurrent PDFs",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of PDF files processed concurrently.",
            "default": 5
          },
          "maxPdfSizeMb": {
            "title": "Max PDF Size (MB)",
            "minimum": 1,
            "maximum": 150,
            "type": "number",
            "description": "Maximum allowed file size per PDF download or base64 payload in megabytes.",
            "default": 30
          },
          "timeoutSecs": {
            "title": "Per-PDF Timeout (Seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout in seconds for downloading and parsing each PDF.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}