{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor & Change Monitor",
    "description": "Extract text, page content, metadata, and RAG-ready chunks from PDFs. Monitor content, page, and metadata changes across runs.",
    "version": "0.1",
    "x-build-id": "NyqvTzAMetr2527ja"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/produkdigitalali~pdf-text-extractor-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-produkdigitalali-pdf-text-extractor-change-monitor",
        "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/produkdigitalali~pdf-text-extractor-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-produkdigitalali-pdf-text-extractor-change-monitor",
        "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/produkdigitalali~pdf-text-extractor-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-produkdigitalali-pdf-text-extractor-change-monitor",
        "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": {
          "uploadedPdf": {
            "title": "Upload or select one PDF",
            "type": "string",
            "description": "Optional single PDF uploaded to an Apify key-value store or supplied by URL."
          },
          "pdfUrls": {
            "title": "PDF URLs",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "Public http(s) PDF URLs to process. Add multiple URLs for batch extraction.",
            "items": {
              "type": "string"
            }
          },
          "documents": {
            "title": "Advanced document definitions",
            "type": "array",
            "description": "Optional JSON objects with url, documentId and label. Use documentId to keep monitoring identity stable when signed/query URLs change.",
            "default": []
          },
          "maxDocuments": {
            "title": "Maximum documents",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of unique PDFs processed in this run.",
            "default": 100
          },
          "includeFullText": {
            "title": "Include full document text",
            "type": "boolean",
            "description": "Include normalized text from all text-bearing pages in the result.",
            "default": true
          },
          "includePageText": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Include text, character count and stable text hash for each page.",
            "default": true
          },
          "includeChunks": {
            "title": "Create RAG-ready chunks",
            "type": "boolean",
            "description": "Create page-aware text chunks with stable chunk IDs and hashes for downstream RAG/vector pipelines.",
            "default": false
          },
          "chunkSizeCharacters": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 10000,
            "type": "integer",
            "description": "Target maximum chunk length when RAG-ready chunks are enabled.",
            "default": 1800
          },
          "chunkOverlapCharacters": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Character overlap between adjacent chunks on the same page.",
            "default": 200
          },
          "maxChunksPerPdf": {
            "title": "Maximum chunks per PDF",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Safety cap for generated RAG chunks per document.",
            "default": 5000
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Optional password for encrypted PDFs. Stored as a secret input."
          },
          "monitorMode": {
            "title": "Monitoring mode",
            "type": "boolean",
            "description": "Compare each successfully processed PDF with persistent state from previous runs using the same monitor key and document identity.",
            "default": false
          },
          "emitChangesOnly": {
            "title": "Emit changes only",
            "type": "boolean",
            "description": "When monitoring, omit UNCHANGED documents from the default dataset.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Namespace for persistent monitoring state. Keep it unchanged across related runs.",
            "default": "default"
          },
          "storeTextForDiff": {
            "title": "Store previous text for line-level diffs",
            "type": "boolean",
            "description": "Stores bounded per-page text in persistent monitoring state so changed pages can include added/removed line snippets.",
            "default": true
          },
          "maxStateCharactersPerPdf": {
            "title": "Maximum stored monitoring text per PDF",
            "minimum": 10000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Maximum characters retained per PDF in persistent state for future line-level diffs.",
            "default": 500000
          },
          "maxDiffLinesPerPage": {
            "title": "Maximum diff lines per changed page",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Caps added/removed line snippets emitted for each changed page while preserving total line counts.",
            "default": 50
          },
          "removeTrackingParams": {
            "title": "Ignore common tracking parameters in document identity",
            "type": "boolean",
            "description": "Removes common utm/fbclid/gclid parameters when deriving stable IDs. The original URL is still downloaded unchanged.",
            "default": true
          },
          "concurrency": {
            "title": "Download concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum PDFs downloaded/processed concurrently.",
            "default": 5
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Per-document download safety limit.",
            "default": 50
          },
          "maxPagesPerPdf": {
            "title": "Maximum pages per PDF",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Rejects PDFs above this page count to keep runtime predictable.",
            "default": 2000
          },
          "maxExtractedCharacters": {
            "title": "Maximum extracted characters per PDF",
            "minimum": 1000,
            "maximum": 20000000,
            "type": "integer",
            "description": "Safety cap for extracted text stored per PDF. The result marks textTruncated when reached.",
            "default": 2000000
          },
          "requestTimeoutSeconds": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout for downloading each PDF.",
            "default": 30
          },
          "maxRetries": {
            "title": "Maximum retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries transient network/429/5xx failures before recording a document failure.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}