{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Structured Tables & Report-Change Watch (JSON)",
    "description": "Extract structured JSON/CSV tables & page-cited RAG Markdown from text-based PDFs and track edition-to-edition table cell changes.",
    "version": "1.0",
    "x-build-id": "b0R5NM0O0JnsMp817"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/structmint~pdf-structured-tables-watch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-structmint-pdf-structured-tables-watch",
        "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/structmint~pdf-structured-tables-watch/runs": {
      "post": {
        "operationId": "runs-sync-structmint-pdf-structured-tables-watch",
        "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/structmint~pdf-structured-tables-watch/run-sync": {
      "post": {
        "operationId": "run-sync-structmint-pdf-structured-tables-watch",
        "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",
        "required": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "Public PDF URLs",
            "type": "array",
            "description": "List of public HTTP/HTTPS URLs pointing to text-based PDF files (fee schedules, catalogs, regulatory bulletins, financial tables). Private/localhost IP addresses are blocked. Free tier processes up to 3 PDFs/run; paid tiers up to 25 PDFs/run.",
            "default": [
              "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "watchMode": {
            "title": "Enable Report-Change Watch Mode",
            "type": "boolean",
            "description": "When enabled, tracks ETag, Last-Modified, and SHA-256 content fingerprints in a user-scoped Named Key-Value Store (90-day retention) and computes edition-to-edition table diffs.",
            "default": false
          },
          "onlyChanged": {
            "title": "Emit Dataset Items Only When PDF Changed",
            "type": "boolean",
            "description": "Used with watchMode=true. Skips emitting dataset items (0 item charges) when the remote PDF has not changed since the previous complete run.",
            "default": true
          },
          "watchStateKey": {
            "title": "Watch State Key",
            "type": "string",
            "description": "Stable namespace key isolating saved baselines for a specific recurring schedule (e.g. 'cloud-fee-schedule-monthly').",
            "default": "default-pdf-watch"
          },
          "storeCellValuesForDiff": {
            "title": "Store Normalized Cell Values for Exact Cell Diffs (Public Reports Only)",
            "type": "boolean",
            "description": "Default false stores only SHA-256 hashes in Named Key-Value Store (zero document text retained). Enable true only on public, non-PII reports to include literal previousValue -> currentValue cell diffs.",
            "default": false
          },
          "tableStrategy": {
            "title": "Table Detection Strategy",
            "enum": [
              "auto",
              "lines",
              "text"
            ],
            "type": "string",
            "description": "'auto' detects ruled/bordered tables first and falls back to whitespace-aligned columns; 'lines' detects bordered tables only; 'text' detects borderless aligned tables.",
            "default": "auto"
          },
          "includeMarkdown": {
            "title": "Include Full Document Markdown",
            "type": "boolean",
            "description": "Include clean document Markdown with rendered Markdown tables in each output item.",
            "default": true
          },
          "includeRagChunks": {
            "title": "Include Page-Cited RAG Chunks",
            "type": "boolean",
            "description": "Split extracted text and tables into bounded Markdown chunks with pageStart/pageEnd citations for LLM/RAG pipelines.",
            "default": true
          },
          "ragChunkMaxChars": {
            "title": "Target RAG Chunk Size (Characters)",
            "minimum": 300,
            "maximum": 8000,
            "type": "integer",
            "description": "Soft character ceiling per RAG chunk (300 to 8000).",
            "default": 1800
          },
          "maxPagesPerPdf": {
            "title": "Max Pages Per PDF",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Maximum number of pages parsed per PDF (Free tier capped at 25 pages; paid tiers up to 150 pages). Partial scans never overwrite a complete watch baseline.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max File Size (MB)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Maximum allowed PDF download size in megabytes (Free tier capped at 10 MB; paid tiers up to 30 MB).",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}