{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Document & Web Analyzer — powered by Claude",
    "description": "Run Claude on pages, PDFs, images, texts or any Apify dataset: several tasks per run, extraction to your JSON schema, cited evidence with verified quotes, exact dataset statistics, dedupe, trends and anomalies without AI cost. Cheapest model by default (Haiku 5.5). Not affiliated with Anthropic.",
    "version": "2.0",
    "x-build-id": "w2S7z1EUsTWGhAVs9"
  },
  "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 100 MB / 600 pages; PDFs above 24 MB go through the Anthropic Files API), DOCX, TXT, MD or CSV files. Each entry must start with http:// or https://.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[hH][tT][tT][pP][sS]?://\\S+"
            }
          },
          "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. Each entry must start with http:// or https://.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[hH][tT][tT][pP][sS]?://\\S+"
            }
          },
          "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. Pick the datasets here (or pass their IDs by API): the Actor gets READ access to these datasets only."
          },
          "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"
            }
          },
          "followLinks": {
            "title": "Follow links found in dataset rows",
            "type": "boolean",
            "description": "v2. For dataset rows: links found in the row (up to \"Links per row\") are opened too. Sonnet 5.5, Opus 5.5 and Fable use Claude's web fetch tool (no tool fee, tokens only; robots.txt respected by Anthropic; limited to the links' own domains). Haiku 5.5 has no verified web fetch tool: the Actor fetches the links itself with its SSRF-safe fetcher (robots.txt respected, private addresses refused).",
            "default": false
          },
          "maxLinksPerItem": {
            "title": "Links per row (followLinks)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum links followed per dataset row.",
            "default": 3
          },
          "tasks": {
            "title": "🧩 Tasks (v2: several tasks in one run)",
            "maxItems": 20,
            "type": "array",
            "description": "Optional. Several tasks on the same sources, each {\"id\", \"type\", \"priority\", \"source\", \"options\"}. AI types: summarize, extract, classify, analyze, detect_key_info, report, custom, qa, compare, contradictions, missing_info, synthesis, evidence (Claude Citations: exact quotes with page / character locations), analytics (Claude code execution on dataset rows). Deterministic types, no AI call: profile, clean, dedupe, cluster, trends, anomalies, align ($0.20 per 1,000 rows read by the data tasks, billed per row: 10 rows = $0.002, once per run, whatever the number of data tasks). dedupe options: \"mode\": \"precise\" (default, fewest false duplicates) or \"balanced\" (finds a few more, a few more mistakes); \"sharedValueRows\" (default 4: a phone / email / website on that many rows is a shared value, not evidence). Duplicates are only MARKED (duplicateGroupId, duplicateOf, duplicateConfidence, duplicateReasons on every row, record MARKED_<taskId>): no row is removed or merged, you decide. Empty = the single \"Task\" below (v1 behaviour). Example: [{\"type\": \"dedupe\"}, {\"type\": \"classify\", \"options\": {\"labels\": [\"positive\", \"negative\"]}}, {\"type\": \"evidence\", \"options\": {\"question\": \"What are the payment terms?\"}}]."
          },
          "dataIntelligence": {
            "title": "Data intelligence on datasets (v2, no AI call)",
            "type": "boolean",
            "description": "Profile, clean, deduplicate and flag anomalies in the rows of \"Apify datasets\" with deterministic code: no Claude call, no API key needed, no per-item fee ($0.20 per 1,000 rows read, billed per row, once per run). Adds the tasks di-profile, di-clean, di-dedupe and di-anomalies (a task type already in \"Tasks\" is not added twice).",
            "default": false
          },
          "dedupeMode": {
            "title": "Duplicate detection mode (v2, no AI call)",
            "enum": [
              "precise",
              "balanced"
            ],
            "type": "string",
            "description": "For the dedupe task (\"Data intelligence\" or a {\"type\": \"dedupe\"} task). Rows are only MARKED (duplicateGroupId, duplicateOf, duplicateConfidence, duplicateReasons), never removed or merged: you decide. Held-out test: precise precision 0.988 / recall 0.940, balanced 0.980 / 0.969.",
            "default": "precise"
          },
          "dedupeSharedValueRows": {
            "title": "Shared value threshold (dedupe)",
            "minimum": 2,
            "type": "integer",
            "description": "A phone, email or website found on this many rows or more (switchboard, chain, mall) is not used as evidence of a duplicate.",
            "default": 4
          },
          "reportTitle": {
            "title": "Report title",
            "maxLength": 200,
            "type": "string",
            "description": "Title of the INTEL_REPORT (HTML) and INTEL_REPORT_MD (Markdown) records written by task runs."
          },
          "useFilesApi": {
            "title": "Use the Files API for large PDFs",
            "type": "boolean",
            "description": "PDFs of 24 MB or more are uploaded once to Anthropic's Files API and referenced by id (deleted at the end of the run, expire after 24 h). Files are not covered by zero data retention: turn this off if your organisation requires ZDR (large PDFs are then sent inline, up to the 128 MB request limit).",
            "default": true
          },
          "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."
          },
          "fieldTypes": {
            "title": "Field types for extraction (optional)",
            "type": "object",
            "description": "extract: {field: type} with date, price (amount, currency), number, email, phone or url. Dates and amounts typed in your outputSchema (format date / date-time, or a price / amount / total field) are normalised anyway; phones, emails and URLs only when typed (here or with format email / uri). The original text is kept in <field>_raw; an ambiguous value (e.g. the date 03/04/2026) becomes null and is listed in ambiguousFields."
          },
          "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",
            "maxLength": 60,
            "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",
              "expert"
            ],
            "type": "string",
            "description": "Depth (Claude's effort setting, adaptive thinking), output limit, default model and item fee: quick = effort low, 8K output, Haiku 5.5, 1 fee unit; standard = effort medium, 16K, Haiku 5.5, 2 units; deep = effort high, 32K, Sonnet 5.5, 2 passes, 4 units; expert = effort xhigh, 64K, Opus 5.5, 3 passes + evidence required, 8 units. An explicit Model always wins. Thinking tokens count as output.",
            "default": "standard"
          },
          "model": {
            "title": "Model",
            "enum": [
              "",
              "claude-haiku-5-5",
              "claude-sonnet-5-5",
              "claude-opus-5-5",
              "claude-fable-5-2",
              "claude-fable-5-1"
            ],
            "type": "string",
            "description": "Default: Claude Haiku 5.5, the cheapest ($0.10 / $0.50 per million input / output tokens up to 100K-token prompts), good for summaries, classification, extraction and key information. Choose Claude Sonnet 5.5 ($2 / $10) or Claude Opus 5.5 ($4 / $20) for harder reasoning, long reports and multi-source synthesis; Claude Fable 5.2 ($8 / $40) is the most capable (needs 30-day data retention on your Anthropic account; own key only). Empty = the analysis level's default (Haiku 5.5 for quick and standard).",
            "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.",
            "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": 100000,
            "type": "integer",
            "description": "Items analysed in this run (texts, pages, documents, images, dataset rows, in that order). Up to 100,000 dataset rows for the AI-free data tasks (profile, clean, dedupe, cluster, trends, anomalies, align); AI tasks always analyse at most the first 10,000 items (and read only the first 10,000 rows). Run memory the data tasks need (all rows of the run together): up to 10,000 rows 512 MB (default) | up to 50,000 rows 1 GB | up to 100,000 rows 4 GB | more than 100,000 rows refused (tooManyRows). Too little memory: the run is refused at start-up (notEnoughMemory), nothing charged. Data tasks: $0.20 per 1,000 rows read, billed per row ($0.0002 per row: 10 rows = $0.002), once per run whatever the number of data tasks; nothing is charged for a refused or failed load.",
            "default": 100
          },
          "batchMode": {
            "title": "Batch mode (v2, -50 %, results within 24 h)",
            "type": "boolean",
            "description": "Big jobs: the items are sent as ONE Claude Message Batch at half the token price (used only from \"Batch: minimum items\" items, otherwise normal calls). The run SUBMITS the batch to Anthropic and ends at once (it never waits); it returns a signed receipt in the key-value store record BATCH_RECEIPT. Nothing is charged at submit. Collect the results later with a run whose input is {\"batchReceipt\": <that record>} (and the same API key); check at most every 30 minutes: a check that finds the batch not finished costs $0.0013 (batch-status-check). Batches end within 24 h and results are kept 29 days. Each item is charged once, at collect. No server-side refusal fallback in batches; the shared prompt is cached for 1 hour.",
            "default": false
          },
          "batchMinItems": {
            "title": "Batch: minimum items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Below this number of items, batch mode is skipped and the items are analysed now with normal calls.",
            "default": 20
          },
          "batchReceipt": {
            "title": "Batch receipt (collect a submitted batch)",
            "type": "object",
            "description": "Paste the BATCH_RECEIPT record of a batch run (object, or a list of them) to COLLECT its results. The receipt is signed: it only works for the Apify user who submitted it, unmodified, until it expires (29 days). One status check per run: if the batch is not finished, the run ends at once with \"not ready, try later\" and nothing is charged."
          },
          "batchMaxWaitSecs": {
            "title": "Batch wait (seconds) - no longer used",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "v1 field, still accepted but not used since v2: a batch run submits and exits, nothing waits. Collect the results with batchReceipt."
          },
          "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."
          },
          "failRunOnError": {
            "title": "Mark the run as FAILED on errors",
            "type": "boolean",
            "description": "Off (default): when your input, key or account stops the work (key rejected, no access, quota used up, unknown model, batch mode unavailable, nothing to analyse, dataset too big for the run memory, timeout near), the run ends SUCCEEDED with a clear status message, the inputs are listed in FAILED_INPUTS with their code and nothing is charged for them; RUN_SUMMARY.status is FAILED. On: such runs end FAILED, for schedules, webhooks or integrations that must react to a failed run.",
            "default": false
          },
          "apiKey": {
            "title": "🔑 Anthropic API key",
            "type": "string",
            "description": "Your key from platform.claude.com (starts with sk-ant-). The AI cost goes to your Anthropic account; the Actor bills a small fee per analysed item. Stored encrypted by Apify, never logged or written to the output. Without a key, the run only estimates tokens and cost (data tasks still run)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}