{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Document & Web Analyzer — powered by Claude",
    "description": "Run Claude on web pages, PDFs, DOCX, images, texts or any Apify dataset: summarize, extract to your JSON schema, classify, compare or report. Bring your own Anthropic API key. Cost caps, token estimates, visual report. Not affiliated with Anthropic.",
    "version": "0.1",
    "x-build-id": "sJxAkoVb0jijpUFDe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/badr_xba~ai-document-web-analyzer-claude/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-badr_xba-ai-document-web-analyzer-claude",
        "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/badr_xba~ai-document-web-analyzer-claude/runs": {
      "post": {
        "operationId": "runs-sync-badr_xba-ai-document-web-analyzer-claude",
        "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/badr_xba~ai-document-web-analyzer-claude/run-sync": {
      "post": {
        "operationId": "run-sync-badr_xba-ai-document-web-analyzer-claude",
        "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": {
          "startUrls": {
            "title": "🌐 Web pages",
            "type": "array",
            "description": "Pages to analyse. Each page is fetched once with a plain HTTP request (honest User-Agent, robots.txt respected, no anti-bot bypass, no JavaScript). The readable text, the title and up to 3 real images are kept. A URL that returns a PDF is read as a document.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "texts": {
            "title": "📝 Texts",
            "type": "array",
            "description": "Raw texts, one per entry (emails, reviews, notes, transcripts…). Each text is one item.",
            "items": {
              "type": "string"
            }
          },
          "documentUrls": {
            "title": "📄 Document URLs",
            "type": "array",
            "description": "Public links to PDF (read natively by Claude, pages and images included, up to 32 MB / 600 pages), DOCX, TXT, MD or CSV files.",
            "items": {
              "type": "string"
            }
          },
          "imageUrls": {
            "title": "🖼️ Image URLs",
            "type": "array",
            "description": "Public JPEG, PNG, GIF or WebP images analysed with Claude's vision (screenshots, receipts, charts, product photos). Claude fetches the image from its URL.",
            "items": {
              "type": "string"
            }
          },
          "includePageImages": {
            "title": "Also send page images to Claude",
            "type": "boolean",
            "description": "Off by default (cheaper): page images are only listed in the output. On: up to 3 images of each web page are also analysed with vision (about 1,600 input tokens each).",
            "default": false
          },
          "datasetIds": {
            "title": "🗂️ Apify datasets (output of other Actors)",
            "type": "array",
            "description": "Dataset IDs from any Actor run (Website Content Crawler, Google Maps, Amazon, Instagram scrapers…). Each row becomes one item. Chain this Actor after a scraper with an integration to add an AI step to its results.",
            "items": {
              "type": "string"
            }
          },
          "datasetFields": {
            "title": "Dataset fields to analyse",
            "type": "array",
            "description": "Which fields of each row to send (dot notation for nested fields, e.g. \"text\", \"metadata.title\", \"reviews\"). Empty = every text and number field of the row.",
            "items": {
              "type": "string"
            }
          },
          "task": {
            "title": "🎯 Task",
            "enum": [
              "summarize",
              "extract",
              "classify",
              "analyze",
              "detect_key_info",
              "compare",
              "report",
              "custom"
            ],
            "type": "string",
            "description": "What Claude does with each item. compare runs ONE analysis across all sources (2 to 10).",
            "default": "summarize"
          },
          "instructions": {
            "title": "Instructions",
            "type": "string",
            "description": "Extra instructions that refine the task (focus, tone, what to look for). Required for the custom task. They cannot override the Actor's rules (no invented facts, source treated as data)."
          },
          "outputSchema": {
            "title": "Output JSON Schema (extract)",
            "type": "object",
            "description": "For the extract task: the JSON Schema of the data you want, e.g. {\"type\":\"object\",\"properties\":{\"company\":{\"type\":\"string\"},\"total\":{\"type\":[\"number\",\"null\"]}}}. Checked before the run; every object gets additionalProperties false and, without \"required\", every property becomes required (null when absent). Supported keywords: type, properties, required, items, enum, const, anyOf, description, title, format, default."
          },
          "labels": {
            "title": "Labels (classify)",
            "type": "array",
            "description": "For the classify task: the allowed labels (at least 2). Each label comes with the basis found in the source and a confidence the model reports.",
            "items": {
              "type": "string"
            }
          },
          "multiLabel": {
            "title": "Several labels per item",
            "type": "boolean",
            "description": "classify: give every label that applies instead of the single best one.",
            "default": false
          },
          "language": {
            "title": "Output language",
            "type": "string",
            "description": "Language of the summaries and texts written by Claude (e.g. English, French, German).",
            "default": "English"
          },
          "analysisLevel": {
            "title": "⚖️ Analysis level",
            "enum": [
              "quick",
              "standard",
              "deep"
            ],
            "type": "string",
            "description": "Depth of reasoning (Claude's effort setting) and output limit: quick = effort low, 8K output tokens; standard = effort medium, 16K; deep = effort high, 32K. Thinking tokens count as output.",
            "default": "standard"
          },
          "model": {
            "title": "Model",
            "enum": [
              "",
              "claude-opus-5-5",
              "claude-sonnet-5-5",
              "claude-haiku-5-5",
              "claude-fable-5-1"
            ],
            "type": "string",
            "description": "Default Claude Opus 5.5 ($4 / $20 per million input / output tokens). Cheaper for high-volume jobs: Claude Sonnet 5.5 ($2 / $10) and Claude Haiku 5.5 ($0.10 / $0.50 up to 100K-token prompts). Most capable: Claude Fable 5.1 ($10 / $50; needs 30-day data retention on your Anthropic account).",
            "default": ""
          },
          "estimateOnly": {
            "title": "Estimate only (no analysis)",
            "type": "boolean",
            "description": "Counts the input tokens of every item (Anthropic's free token-counting endpoint) and estimates the cost per item and in total, without any analysis call.",
            "default": false
          },
          "maxCostUsd": {
            "title": "Maximum AI cost per run (USD, estimate)",
            "minimum": 0,
            "type": "number",
            "description": "The run stops before a request whose worst case (input + the full output limit) would take the estimated AI cost above this amount. 0 = no limit.",
            "default": 0
          },
          "maxTotalTokens": {
            "title": "Maximum tokens per run",
            "minimum": 0,
            "type": "integer",
            "description": "Same check on tokens (input + output). 0 = no limit (managed key: capped at 2,000,000).",
            "default": 0
          },
          "maxInputTokensPerItem": {
            "title": "Maximum input tokens per request",
            "minimum": 2000,
            "maximum": 860000,
            "type": "integer",
            "description": "Longer sources are split into parts, each part summarised, then the task runs on the combined notes. Never cut silently: an item that still does not fit says truncated: true with the reason.",
            "default": 150000
          },
          "maxOutputTokensPerItem": {
            "title": "Maximum output tokens per request",
            "minimum": 0,
            "maximum": 128000,
            "type": "integer",
            "description": "0 = the analysis level's limit. Thinking tokens are included. A cut answer is retried once with twice the limit.",
            "default": 0
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Items analysed in this run (texts, pages, documents, images, dataset rows, in that order).",
            "default": 100
          },
          "useBatchApi": {
            "title": "Use the Message Batches API (50 % cheaper, slower)",
            "type": "boolean",
            "description": "For big, non-urgent jobs: requests go to Anthropic's batch queue (most finish within an hour, up to 24 h) at half price. The run waits up to \"Batch wait\" and cancels what is not done. No server-side refusal fallback in batches.",
            "default": false
          },
          "batchMaxWaitSecs": {
            "title": "Batch wait (seconds)",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "How long the run waits for a batch before canceling the unfinished requests. Keep the run timeout above it.",
            "default": 3600
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Items processed at the same time. Lower it if your Anthropic rate limits are small (429 errors are retried with back-off).",
            "default": 3
          },
          "itemTimeoutSecs": {
            "title": "Timeout per item (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "An item still running after this time is stopped and the run moves on. Leave empty: the default fits the output limit (twice maxOutputTokensPerItem at 30 tokens/s + 60 s, at least 600). Anthropic bills tokens generated before a timeout. With the managed key a lower value is raised."
          },
          "apiKeyMode": {
            "title": "🔑 API key",
            "enum": [
              "own_key",
              "managed"
            ],
            "type": "string",
            "description": "own_key: your Anthropic API key; the AI cost goes to your Anthropic account and the Actor bills a small fee per analysed item. managed: no key needed (paid Apify plans only); tokens are billed per 1,000 on Apify.",
            "default": "own_key"
          },
          "apiKey": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "Your key from platform.claude.com (starts with sk-ant-). Stored encrypted by Apify, never logged or written to the output. Without a key, the run only estimates tokens and cost."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}