{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Inspector: Scanned PDF Detector & Metadata Audit",
    "description": "Bulk PDF audit before OCR or text extraction: which pages are scanned and need OCR, which files are encrypted, what the metadata leaks (author, local paths), embedded JavaScript and attachments, PDF/A and PDF/UA conformance, unembedded fonts, and every link inside the document.",
    "version": "0.1",
    "x-build-id": "efkLxohDfJ63KvS4y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aiqlabs~pdf-inspector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aiqlabs-pdf-inspector",
        "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/aiqlabs~pdf-inspector/runs": {
      "post": {
        "operationId": "runs-sync-aiqlabs-pdf-inspector",
        "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/aiqlabs~pdf-inspector/run-sync": {
      "post": {
        "operationId": "run-sync-aiqlabs-pdf-inspector",
        "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": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. Redirects are followed and the URL that actually answered is reported back.",
            "default": [
              "https://www.irs.gov/pub/irs-pdf/f1040.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "extractText": {
            "title": "Also extract the text",
            "type": "boolean",
            "description": "Return the readable text of each document alongside the audit. Off by default, because the audit is what tells you whether extracting text is even possible.",
            "default": false
          },
          "maxTextChars": {
            "title": "Text characters per document",
            "minimum": 500,
            "maximum": 500000,
            "type": "integer",
            "description": "Upper bound on the extracted text kept per file. Only used when text extraction is on.",
            "default": 20000
          },
          "checkLinks": {
            "title": "Check the links inside each PDF",
            "type": "boolean",
            "description": "Request every link found in the document annotations and report which ones are dead. Adds one HTTP request per link, so it is off by default.",
            "default": false
          },
          "maxLinksToCheck": {
            "title": "Links to check per document",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper bound on link requests per file. Anything above this is still listed, just not checked.",
            "default": 50
          },
          "onlyIssues": {
            "title": "Only output files that need attention",
            "type": "boolean",
            "description": "Keep rows whose status is warning or error and drop the clean ones. Notices such as \"not tagged\" do not count as attention, so this stays useful on real batches.",
            "default": false
          },
          "maxPages": {
            "title": "Pages to inspect per document",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Page-level inspection stops after this many pages. The page count, metadata and security findings still cover the whole file.",
            "default": 200
          },
          "maxOcrProbePages": {
            "title": "Pages to probe for images",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Deciding whether a page with no text is scanned or simply blank means reading its drawing instructions, which is the expensive part. Pages beyond this budget are reported as unprobed rather than guessed.",
            "default": 25
          },
          "maxFileMb": {
            "title": "Maximum file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this are refused before they are downloaded in full.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 3,
            "maximum": 300,
            "type": "integer",
            "description": "Give up on a single download after this many seconds.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to download and parse at the same time. Parsing holds the whole file in memory, so raising this on large documents raises memory use in step.",
            "default": 5
          },
          "maxPdfs": {
            "title": "Maximum files per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety stop for very long input lists.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}