{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/internetdata-io/json-schema/internetdata-io-asn-lookup-response-schema.json",
  "title": "AsnLookupResponse",
  "description": "What every database says about one AS.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/internetdata-io-lookup-api-openapi.yml#/components/schemas/AsnLookupResponse",
  "type": "object",
  "properties": {
    "asn": {
      "type": "integer",
      "description": "The AS number."
    },
    "name": {
      "type": "string",
      "description": "Its operator."
    },
    "country": {
      "type": "string",
      "description": "The country its registry assigned it to."
    },
    "registry": {
      "type": "string",
      "description": "The registry that allocated it."
    },
    "allocated": {
      "type": "string",
      "description": "When."
    },
    "domain": {
      "type": "string",
      "description": "Its operator's domain."
    },
    "type": {
      "type": "string",
      "description": "The kind of network it runs. Paid plans and the trial."
    },
    "num_ips": {
      "type": "integer",
      "description": "IPv4 addresses it announces. Paid plans and the trial."
    },
    "num_prefixes4": {
      "type": "integer",
      "description": "IPv4 prefixes it announces. Paid plans and the trial."
    },
    "num_prefixes6": {
      "type": "integer",
      "description": "IPv6 prefixes it announces. Paid plans and the trial."
    },
    "rpki_valid": {
      "type": "integer",
      "description": "Its announcements RPKI calls valid. Paid plans and the trial."
    },
    "rpki_invalid": {
      "type": "integer",
      "description": "Invalid. Paid plans and the trial."
    },
    "rpki_not_found": {
      "type": "integer",
      "description": "With no RPKI record. Paid plans and the trial."
    },
    "whois": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Its ASN Whois record, every column, empty where the registry states nothing. Paid plans and the trial."
    },
    "prefixes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AsnPrefix"
      },
      "description": "What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial."
    },
    "rank": {
      "type": "integer",
      "description": "Its rank in ASN Extended, by customer cone, 1 the largest; `0` for an AS seen in no AS path. Paid plans and the trial."
    },
    "tier1": {
      "type": "boolean",
      "description": "Whether it is one of the transit-free networks at the top of the hierarchy, which get transit from no one and peer with each other. Paid plans and the trial."
    },
    "num_upstreams": {
      "type": "integer",
      "description": "How many AS numbers it gets transit from. Paid plans and the trial."
    },
    "upstreams": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Those AS numbers, ascending, up to 20000. Paid plans and the trial."
    },
    "num_peers": {
      "type": "integer",
      "description": "How many AS numbers it exchanges its own and its customers' routes with. Paid plans and the trial."
    },
    "peers": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Those AS numbers, ascending, up to 20000. Paid plans and the trial."
    },
    "num_downstreams": {
      "type": "integer",
      "description": "How many AS numbers it provides transit to. Paid plans and the trial."
    },
    "downstreams": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Those AS numbers, ascending, up to 20000. Paid plans and the trial."
    },
    "hosted_domains": {
      "$ref": "#/$defs/AsnHostedDomains"
    },
    "trial_expired": {
      "type": "boolean",
      "description": "On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields."
    },
    "cap_reached": {
      "type": "boolean",
      "description": "On every answer to a key on a paid plan, and on no other: `false` while the answer has every field, `true` once its organization's overage cap is reached and the answer has Unlimited's. Lookups answered past the cap are not billed; raising or removing the cap in Billing turns it `false` again."
    }
  },
  "required": [
    "asn",
    "name",
    "country",
    "registry",
    "allocated",
    "domain"
  ],
  "$defs": {
    "AsnHostedDomains": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "description": "How many registered domains resolve to an address the AS announces."
        },
        "domains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Up to 10 of them, the most popular first; `[]` when none does."
        }
      },
      "required": [
        "total"
      ],
      "description": "From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. Paid plans and the trial."
    },
    "AsnPrefix": {
      "type": "object",
      "properties": {
        "prefix": {
          "type": "string",
          "description": "The announced prefix."
        },
        "peer_count": {
          "type": "integer",
          "description": "How many peers saw it."
        },
        "rpki_status": {
          "type": "string",
          "description": "Its RPKI status."
        },
        "first_seen": {
          "type": "string",
          "description": "The first day BGP Route saw it."
        },
        "country": {
          "type": "string",
          "description": "Where its first address is."
        },
        "size": {
          "type": "integer",
          "description": "IPv4 addresses it covers; 0 for IPv6."
        },
        "other_origins": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Every other AS announcing it."
        }
      },
      "required": [
        "prefix",
        "peer_count",
        "rpki_status",
        "first_seen",
        "country",
        "size",
        "other_origins"
      ]
    }
  }
}