{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/networkdatalabs-com/json-schema/networkdatalabs-com-ip-lookup-schema.json",
  "title": "IpLookup",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/networkdatalabs-com-openapi.yml#/components/schemas/IpLookup",
  "type": "object",
  "required": [
    "ip",
    "location",
    "network",
    "traits"
  ],
  "properties": {
    "ip": {
      "type": "string"
    },
    "location": {
      "$ref": "#/$defs/Location"
    },
    "network": {
      "$ref": "#/$defs/Network"
    },
    "traits": {
      "$ref": "#/$defs/Traits"
    }
  },
  "$defs": {
    "Location": {
      "type": "object",
      "required": [
        "continent_code",
        "country_code",
        "country",
        "accuracy_radius_km",
        "confidence"
      ],
      "properties": {
        "continent_code": {
          "type": "string",
          "description": "Continent code (e.g. NA, EU, AS)"
        },
        "country_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-3166-1 alpha-2"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_eu": {
          "type": "boolean",
          "description": "Whether the country is in the European Union"
        },
        "region": {
          "type": [
            "string",
            "null"
          ]
        },
        "region_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "postal": {
          "type": [
            "string",
            "null"
          ]
        },
        "latitude": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "longitude": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA timezone"
        },
        "accuracy_radius_km": {
          "type": [
            "number",
            "null"
          ],
          "description": "Estimated accuracy radius in kilometers. Always present when geo is returned;\nit tells you how precise the location is. Wide radii (e.g. 1000) mean city is a best-effort guess.\n"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low",
            "unknown"
          ],
          "description": "Qualitative confidence in the geo estimate"
        }
      }
    },
    "Network": {
      "type": "object",
      "properties": {
        "asn": {
          "type": [
            "integer",
            "null"
          ]
        },
        "as_org": {
          "type": [
            "string",
            "null"
          ]
        },
        "isp": {
          "type": [
            "string",
            "null"
          ]
        },
        "organization": {
          "type": [
            "string",
            "null"
          ]
        },
        "network": {
          "type": [
            "string",
            "null"
          ],
          "description": "Containing prefix (CIDR)"
        },
        "rir": {
          "type": [
            "string",
            "null"
          ],
          "description": "Regional Internet Registry"
        }
      }
    },
    "Traits": {
      "type": "object",
      "required": [
        "is_bogon",
        "is_mobile",
        "is_satellite"
      ],
      "properties": {
        "is_anycast": {
          "type": "boolean",
          "description": "True when the IP is a well-known anycast DNS resolver (e.g. 8.8.8.8, 1.1.1.1)."
        },
        "is_hosting": {
          "type": "boolean",
          "description": "True when the IP belongs to a hosting, datacenter, cloud, or CDN network. Paid plans only (Starter, Growth, Scale). Omitted from Free-plan responses."
        },
        "is_mobile": {
          "type": "boolean",
          "description": "True when the IP is on a mobile carrier network."
        },
        "is_satellite": {
          "type": "boolean",
          "description": "True when the IP is on a satellite internet network."
        },
        "is_bogon": {
          "type": "boolean",
          "description": "True when the IP is in a private or special-use range (RFC1918 private, loopback, link-local, multicast, documentation/benchmark)."
        },
        "is_proxy": {
          "type": "boolean",
          "description": "Paid plans only (Starter, Growth, Scale). Omitted from Free-plan responses."
        },
        "is_vpn": {
          "type": "boolean",
          "description": "True when the IP belongs to a known VPN network, including major commercial VPN providers. Privacy relay egress IPs are reported as is_relay, not is_vpn. Paid plans only (Starter, Growth, Scale). Omitted from Free-plan responses."
        },
        "is_tor": {
          "type": "boolean",
          "description": "True when the IP is a current Tor exit node. Paid plans only (Starter, Growth, Scale). Omitted from Free-plan responses."
        },
        "is_relay": {
          "type": "boolean",
          "description": "True when the IP is a privacy relay egress address. Paid plans only (Starter, Growth, Scale). Omitted from Free-plan responses."
        }
      }
    }
  }
}