{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/webrevenuescan-com/json-schema/webrevenuescan-com-scan-result-schema.json",
  "title": "ScanResult",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/webrevenuescan-com-openapi.json#/components/schemas/ScanResult",
  "type": "object",
  "required": [
    "tool",
    "url",
    "score",
    "grade",
    "summary",
    "findings",
    "data",
    "credits_used",
    "request_id"
  ],
  "properties": {
    "tool": {
      "type": "string",
      "enum": [
        "tech-stack",
        "consent-tracking",
        "speed",
        "accessibility",
        "ai-readiness",
        "domain-health",
        "seo-basics",
        "privacy-policy",
        "web-to-markdown",
        "full-audit"
      ]
    },
    "url": {
      "type": "string",
      "description": "Normalised input URL (or domain for domain-health)."
    },
    "final_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "score": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 100
    },
    "grade": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "A",
        "B",
        "C",
        "D",
        "F",
        null
      ]
    },
    "summary": {
      "type": "string"
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Finding"
      }
    },
    "data": {
      "type": "object",
      "additionalProperties": true,
      "description": "Tool-specific details (see each tool)."
    },
    "disclaimer": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "request_id": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "backend": {
      "type": "string",
      "enum": [
        "inprocess",
        "apify",
        "cache"
      ]
    },
    "duration_ms": {
      "type": "integer"
    },
    "scanned_at": {
      "type": "string",
      "format": "date-time"
    },
    "test_mode": {
      "type": "boolean"
    }
  },
  "$defs": {
    "Finding": {
      "type": "object",
      "required": [
        "id",
        "severity",
        "title",
        "detail",
        "fix"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "critical",
            "high",
            "medium",
            "low",
            "info"
          ]
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "fix": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}