{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dns-coffee/json-schema/dns-coffee-domain-neighbors-body-schema.json",
  "title": "DomainNeighborsBody",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dns-coffee-domains-api-openapi.yml#/components/schemas/DomainNeighborsBody",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "A URL to the JSON Schema for this object.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "basis": {
      "description": "The basis used: name or ip.",
      "type": "string"
    },
    "count": {
      "description": "Total number of neighbor domains, counted up to a cap.",
      "format": "int64",
      "type": "integer"
    },
    "count_capped": {
      "description": "True when the count hit its cap, so the true total is at least count.",
      "type": "boolean"
    },
    "domain": {
      "description": "The queried domain.",
      "type": "string"
    },
    "has_more": {
      "description": "True when more neighbors follow this page in mode=exact; repeat the request with cursor set to next_cursor to fetch them. Always false in superset and overlap modes, which return a single page.",
      "type": "boolean"
    },
    "mode": {
      "description": "The match mode used: exact, superset, or overlap.",
      "type": "string"
    },
    "neighbors": {
      "description": "The neighbor domains. In overlap mode each carries shared_count (how many basis elements it shares); exact and superset omit it.",
      "items": {
        "$ref": "#/$defs/DomainNeighbor"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "next_cursor": {
      "description": "Opaque cursor for the next mode=exact page; pass it back as the cursor parameter with the same domain, basis and mode. Absent on the last page.",
      "type": "string"
    }
  },
  "required": [
    "domain",
    "basis",
    "mode",
    "count",
    "count_capped",
    "neighbors",
    "has_more"
  ],
  "type": "object",
  "$defs": {
    "DomainNeighbor": {
      "additionalProperties": false,
      "properties": {
        "active": {
          "description": "True when any of the domain's nameserver records is current.",
          "type": "boolean"
        },
        "domain": {
          "description": "The matched domain name.",
          "type": "string"
        },
        "first_seen": {
          "description": "Date the domain was first observed. Absent when it was already present when tracking of its zone began.",
          "format": "date-time",
          "type": "string"
        },
        "last_seen": {
          "description": "Date the domain was last observed. Absent while it is still active.",
          "format": "date-time",
          "type": "string"
        },
        "shared_count": {
          "description": "How many nameservers (name basis) or nameserver IPs (ip basis) this domain shares with the queried domain. Meaningful only in overlap mode; omitted in exact and superset modes, where every neighbor shares the whole set.",
          "format": "int64",
          "type": "integer"
        },
        "zone": {
          "description": "The zone (TLD) the domain belongs to, in punycode.",
          "type": "string"
        }
      },
      "required": [
        "zone",
        "domain",
        "active"
      ],
      "type": "object"
    }
  }
}