{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bewary/json-schema/bewary-site-calibration-schema.json",
  "title": "SiteCalibration",
  "description": "GET /v1/calibration/site (1.4.0): how the domain verdict's score maps to the probability `site.p_scam_site`\nserves, and what each band's labelled hosts were (docs/b2b/PRECISION.md).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bewary-calibration-api-openapi.yml#/components/schemas/SiteCalibration",
  "properties": {
    "schema_version": {
      "type": "string",
      "title": "Schema Version"
    },
    "version": {
      "type": "string",
      "title": "Version",
      "description": "The fit, e.g. site-cal-20261030-702; `site.calibration` names it."
    },
    "fitted_at": {
      "type": "string",
      "title": "Fitted At",
      "description": "When it was fitted, RFC 3339 UTC."
    },
    "population": {
      "type": "string",
      "title": "Population",
      "description": "Which hosts it applies to."
    },
    "labels": {
      "type": "string",
      "title": "Labels",
      "description": "How the labelled hosts were labelled."
    },
    "points": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Points",
      "description": "Labelled hosts in the fit."
    },
    "scam_sites": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Scam Sites",
      "description": "How many of them were scam or compromised sites."
    },
    "confidence": {
      "type": "number",
      "title": "Confidence",
      "description": "The confidence of every band's interval."
    },
    "bands": {
      "items": {
        "$ref": "#/$defs/CalibrationBand"
      },
      "type": "array",
      "title": "Bands"
    }
  },
  "type": "object",
  "required": [
    "schema_version",
    "version",
    "fitted_at",
    "population",
    "labels",
    "points",
    "scam_sites",
    "confidence",
    "bands"
  ],
  "$defs": {
    "CalibrationBand": {
      "properties": {
        "score_from": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Score From",
          "description": "The band's lowest score (inclusive)."
        },
        "score_to": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Score To",
          "description": "The band's highest score (exclusive, but 1.0 is in the top band)."
        },
        "hosts": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Hosts",
          "description": "Labelled hosts whose score fell in this band."
        },
        "scam_sites": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Scam Sites",
          "description": "How many of them were scam or compromised sites."
        },
        "p_low": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "P Low",
          "description": "95% interval of the band's scam share, low end (Clopper-Pearson)."
        },
        "p_high": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "P High",
          "description": "95% interval of the band's scam share, high end."
        },
        "p_scam_site": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "P Scam Site",
          "description": "The probability served for a score in this band."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "score_from",
        "score_to",
        "hosts",
        "scam_sites",
        "p_low",
        "p_high",
        "p_scam_site"
      ],
      "title": "CalibrationBand"
    }
  }
}