{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ipgeolocation/json-schema/ipgeolocation-ip-geolocation-response-schema.json",
  "title": "IpGeolocationResponse",
  "description": "The top-level response object for a single IP lookup. Where fields and nested\nobjects appear depends on your plan (free vs. paid) and the `include`, `fields`,\nand `excludes` parameters. The `ip` field is always present.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ipgeolocation-ip-geolocation-api-openapi.yml#/components/schemas/IpGeolocationResponse",
  "type": "object",
  "required": [
    "ip"
  ],
  "properties": {
    "ip": {
      "type": "string",
      "description": "The looked-up IP address. If a domain was queried, this is the resolved IP.\nIf no `ip` parameter was sent, this is the caller's public IP.\n"
    },
    "domain": {
      "type": "string",
      "description": "Present only when the `ip` query parameter contained a domain name. Mirrors\nthe domain value from the request.\n"
    },
    "hostname": {
      "type": "string",
      "description": "Reverse-DNS hostname for the IP. Returned only when one of the hostname\n`include` options is used (`hostname`, `liveHostname`, or\n`hostnameFallbackLive`). If no hostname can be resolved, this field contains\nthe IP address itself.\n"
    },
    "location": {
      "$ref": "#/$defs/Location"
    },
    "country_metadata": {
      "$ref": "#/$defs/CountryMetadata"
    },
    "network": {
      "$ref": "#/$defs/Network"
    },
    "currency": {
      "$ref": "#/$defs/Currency"
    },
    "asn": {
      "$ref": "#/$defs/Asn"
    },
    "company": {
      "$ref": "#/$defs/Company"
    },
    "security": {
      "$ref": "#/$defs/Security"
    },
    "abuse": {
      "$ref": "#/$defs/Abuse"
    },
    "time_zone": {
      "$ref": "#/$defs/TimeZone"
    },
    "user_agent": {
      "$ref": "#/$defs/UserAgent"
    }
  },
  "$defs": {
    "Abuse": {
      "type": "object",
      "description": "Abuse contact information for the network that owns this IP. Only returned when\n`include=abuse` or `include=*` is used. Costs 1 additional credit.\n",
      "properties": {
        "route": {
          "type": "string",
          "description": "BGP route prefix this abuse contact is responsible for, in CIDR notation."
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country of the abuse contact. May be empty."
        },
        "name": {
          "type": "string",
          "description": "Name of the abuse contact person or team."
        },
        "organization": {
          "type": "string",
          "description": "Organization name of the abuse contact. May be empty."
        },
        "kind": {
          "type": "string",
          "description": "Contact type from registry data. Values include `group`, `individual`.\n"
        },
        "address": {
          "type": "string",
          "description": "Postal address of the abuse contact. Returned as a plain comma-separated string."
        },
        "emails": {
          "type": "array",
          "description": "Email addresses for reporting abuse.",
          "items": {
            "type": "string",
            "format": "email"
          }
        },
        "phone_numbers": {
          "type": "array",
          "description": "Phone numbers for the abuse contact.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Asn": {
      "type": "object",
      "description": "Autonomous System Number details for the IP. Free plans receive `as_number`,\n`organization`, and `country` only. Paid plans also receive `type`, `domain`,\n`date_allocated`, and `rir`.\n",
      "properties": {
        "as_number": {
          "type": "string",
          "description": "AS number prefixed with `AS` (e.g. `AS1257`)."
        },
        "organization": {
          "type": "string",
          "description": "Name of the organization that owns the ASN."
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country where the ASN is registered."
        },
        "type": {
          "type": "string",
          "description": "Organization type. Values: `ISP`, `HOSTING`, `BUSINESS`, `EDUCATION`,\n`GOVERNMENT`. Paid plans only.\n"
        },
        "domain": {
          "type": "string",
          "description": "Primary domain of the ASN holder. Paid plans only."
        },
        "date_allocated": {
          "type": "string",
          "description": "Date when the ASN was allocated, in `YYYY-MM-DD` format (e.g.\n`2024-12-13`). Paid plans only.\n"
        },
        "rir": {
          "type": "string",
          "description": "Regional Internet Registry (RIR) that allocated the ASN. Possible values include `RIPE`, `ARIN`, `APNIC`, `LACNIC`, `AFRINIC`, etc.\n"
        }
      }
    },
    "Company": {
      "type": "object",
      "description": "Company or organization operating the IP range. Included by default on paid\nplans. Not available on the free plan.\n",
      "properties": {
        "name": {
          "type": "string",
          "description": "Company or organization name."
        },
        "type": {
          "type": "string",
          "description": "Company category. Documented values: `ISP`, `HOSTING`, `BUSINESS`,\n`EDUCATION`, `GOVERNMENT`. All uppercase, consistent with `asn.type`.\nMay be an empty string when the company type cannot be determined.\n"
        },
        "domain": {
          "type": "string",
          "description": "Primary domain of the company."
        }
      }
    },
    "CountryMetadata": {
      "type": "object",
      "description": "Telephone, TLD, and language information for the country.",
      "properties": {
        "calling_code": {
          "type": "string",
          "description": "International dialing code with leading `+`."
        },
        "tld": {
          "type": "string",
          "description": "Country-code top-level domain."
        },
        "languages": {
          "type": "array",
          "description": "IETF language tags spoken in the country, ordered by prevalence.\n",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Currency": {
      "type": "object",
      "description": "Local currency of the country where the IP is located.",
      "properties": {
        "code": {
          "type": "string",
          "description": "ISO 4217 currency code."
        },
        "name": {
          "type": "string",
          "description": "Currency name."
        },
        "symbol": {
          "type": "string",
          "description": "Currency symbol."
        }
      }
    },
    "DstTransition": {
      "type": "object",
      "description": "Details about a DST transition (start or end). Only present when `dst_exists`\nis `true`. When `dst_exists` is `false`, `dst_start` and `dst_end` are\nreturned as empty objects with no properties.\n",
      "properties": {
        "utc_time": {
          "type": "string",
          "description": "UTC time of the transition, formatted as `YYYY-MM-DD TIME HH:mm`."
        },
        "duration": {
          "type": "string",
          "description": "Clock shift direction and amount (e.g. `+1.00H` for spring forward,\n`-1.00H` for fall back).\n"
        },
        "gap": {
          "type": "boolean",
          "description": "Whether this transition creates a gap in local time (clocks jump forward).\n`true` for DST start, `false` for DST end.\n"
        },
        "date_time_after": {
          "type": "string",
          "description": "Local time immediately after the transition."
        },
        "date_time_before": {
          "type": "string",
          "description": "Local time immediately before the transition."
        },
        "overlap": {
          "type": "boolean",
          "description": "Whether this transition creates an overlap in local time (clocks fall back,\nso the same local time occurs twice). `true` for DST end, `false` for DST\nstart.\n"
        }
      }
    },
    "Location": {
      "type": "object",
      "description": "Geographic location data for the IP address.",
      "properties": {
        "continent_code": {
          "type": "string",
          "description": "Two-letter continent code (e.g. `EU`, `NA`, `AS`)."
        },
        "continent_name": {
          "type": "string",
          "description": "Full continent name."
        },
        "country_code2": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code."
        },
        "country_code3": {
          "type": "string",
          "description": "ISO 3166-1 alpha-3 country code."
        },
        "country_name": {
          "type": "string",
          "description": "Common country name."
        },
        "country_name_official": {
          "type": "string",
          "description": "Official country name as recognized by the UN."
        },
        "country_capital": {
          "type": "string",
          "description": "Capital city of the country."
        },
        "state_prov": {
          "type": "string",
          "description": "State, province, or top-level administrative region."
        },
        "state_code": {
          "type": "string",
          "description": "ISO 3166-2 state or province code."
        },
        "district": {
          "type": "string",
          "description": "District, county, or second-level administrative division."
        },
        "city": {
          "type": "string",
          "description": "City name."
        },
        "locality": {
          "type": "string",
          "description": "Locality or neighborhood. May be the same as `city`. Only present when\n`include=geo_accuracy` or `include=*` is used.\n"
        },
        "accuracy_radius": {
          "type": "string",
          "description": "Estimated accuracy radius in kilometers around `latitude` and `longitude`.\nOnly present when `include=geo_accuracy` or `include=*` is used.\n"
        },
        "confidence": {
          "type": "string",
          "description": "Confidence level for the accuracy radius. Possible values: `high`, `medium`,\n`low`. Only present when `include=geo_accuracy` or `include=*` is used.\n",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "dma_code": {
          "type": "string",
          "description": "Nielsen Designated Market Area code. Only populated for US-based IPs.\nPresent when `include=dma_code` or `include=*` is used. Empty string for\nnon-US IPs.\n"
        },
        "zipcode": {
          "type": "string",
          "description": "Postal or ZIP code."
        },
        "latitude": {
          "type": "string",
          "description": "Latitude in decimal degrees (WGS 84)."
        },
        "longitude": {
          "type": "string",
          "description": "Longitude in decimal degrees (WGS 84)."
        },
        "is_eu": {
          "type": "boolean",
          "description": "Whether the country is a member of the European Union."
        },
        "country_flag": {
          "type": "string",
          "format": "uri",
          "description": "URL to a 64x64 PNG of the country flag."
        },
        "geoname_id": {
          "type": "string",
          "description": "GeoNames identifier for the location."
        },
        "country_emoji": {
          "type": "string",
          "description": "Unicode flag emoji for the country."
        }
      }
    },
    "Network": {
      "type": "object",
      "description": "Network routing information for the IP. Included by default on paid plans.\nNot available on the free plan.\n",
      "properties": {
        "connection_type": {
          "type": "string",
          "description": "Type of network connection for this IP. Known values: `DSL`, `Cable`,\n`Fiber`, `Mobile`, `Wireless`, `Dial-Up/ISDN`, `Satellite`. Empty string\nwhen the type cannot be determined.\n"
        },
        "route": {
          "type": "string",
          "description": "BGP route prefix in CIDR notation."
        },
        "is_anycast": {
          "type": "boolean",
          "description": "Whether the IP is part of an anycast network."
        }
      }
    },
    "Security": {
      "type": "object",
      "description": "Threat intelligence and anonymization signals for the IP. Only returned when\n`include=security` or `include=*` is used. Costs 2 additional credits.\n",
      "properties": {
        "threat_score": {
          "type": "number",
          "description": "Overall threat score from 0 (clean) to 100 (high risk). Aggregated from\nall the individual signals below.\n",
          "minimum": 0,
          "maximum": 100
        },
        "is_tor": {
          "type": "boolean",
          "description": "Whether the IP is a known Tor exit node."
        },
        "is_proxy": {
          "type": "boolean",
          "description": "Whether the IP belongs to a known proxy service."
        },
        "proxy_provider_names": {
          "type": "array",
          "description": "Names of proxy providers associated with this IP, if any.",
          "items": {
            "type": "string"
          }
        },
        "proxy_confidence_score": {
          "type": "number",
          "description": "Confidence that this IP is a proxy, from 0 to 100. Only meaningful when\n`is_proxy` is `true`.\n",
          "minimum": 0,
          "maximum": 100
        },
        "proxy_last_seen": {
          "type": "string",
          "description": "Date when this IP was last observed acting as a proxy, in `YYYY-MM-DD`\nformat. Empty string if never seen.\n"
        },
        "is_residential_proxy": {
          "type": "boolean",
          "description": "Whether the IP is a known residential proxy."
        },
        "is_vpn": {
          "type": "boolean",
          "description": "Whether the IP belongs to a known VPN provider."
        },
        "vpn_provider_names": {
          "type": "array",
          "description": "Names of VPN providers associated with this IP, if any.",
          "items": {
            "type": "string"
          }
        },
        "vpn_confidence_score": {
          "type": "number",
          "description": "Confidence that this IP is a VPN endpoint, from 0 to 100. Only meaningful\nwhen `is_vpn` is `true`.\n",
          "minimum": 0,
          "maximum": 100
        },
        "vpn_last_seen": {
          "type": "string",
          "description": "Date when this IP was last observed as a VPN endpoint, in `YYYY-MM-DD`\nformat. Empty string if never seen.\n"
        },
        "is_relay": {
          "type": "boolean",
          "description": "Whether the IP is part of a known relay network (e.g. iCloud Private Relay)."
        },
        "relay_provider_name": {
          "type": "string",
          "description": "Name of the relay provider, if any. Empty string if not a relay."
        },
        "is_anonymous": {
          "type": "boolean",
          "description": "Whether the IP is associated with any anonymization method (VPN, proxy,\nTor, or relay).\n"
        },
        "is_known_attacker": {
          "type": "boolean",
          "description": "Whether the IP has been flagged in known attacker or threat feeds."
        },
        "is_bot": {
          "type": "boolean",
          "description": "Whether the IP is associated with known bot activity."
        },
        "is_spam": {
          "type": "boolean",
          "description": "Whether the IP is listed in spam databases."
        },
        "is_cloud_provider": {
          "type": "boolean",
          "description": "Whether the IP belongs to a cloud hosting or data center provider."
        },
        "cloud_provider_name": {
          "type": "string",
          "description": "Name of the cloud provider, if applicable. Empty string otherwise."
        }
      }
    },
    "TimeZone": {
      "type": "object",
      "description": "Timezone information for the geographic location of the IP.",
      "properties": {
        "name": {
          "type": "string",
          "description": "IANA timezone identifier."
        },
        "offset": {
          "type": "number",
          "format": "float",
          "description": "UTC offset in hours (without DST)."
        },
        "offset_with_dst": {
          "type": "number",
          "format": "float",
          "description": "Current UTC offset in hours, accounting for DST if active. Same as\n`offset` when DST is not in effect.\n"
        },
        "current_time": {
          "type": "string",
          "description": "Current local time at the IP's location. Observed formats include\n`YYYY-MM-DDTHH:mm:ss±ZZZZ` and `YYYY-MM-DD HH:mm:ss.SSS±ZZZZ`.\n"
        },
        "current_time_unix": {
          "type": "number",
          "format": "float",
          "description": "Current time as a Unix timestamp with millisecond precision."
        },
        "current_tz_abbreviation": {
          "type": "string",
          "description": "Abbreviation of the timezone currently in effect (may be standard or DST).\n"
        },
        "current_tz_full_name": {
          "type": "string",
          "description": "Full name of the timezone currently in effect."
        },
        "standard_tz_abbreviation": {
          "type": "string",
          "description": "Abbreviation of the standard (non-DST) timezone."
        },
        "standard_tz_full_name": {
          "type": "string",
          "description": "Full name of the standard (non-DST) timezone."
        },
        "is_dst": {
          "type": "boolean",
          "description": "Whether Daylight Saving Time is currently active."
        },
        "dst_savings": {
          "type": "number",
          "format": "float",
          "description": "DST offset in hours applied on top of the standard offset when DST is\nactive. `0` means no DST shift (either DST is not active or does not exist).\n"
        },
        "dst_exists": {
          "type": "boolean",
          "description": "Whether this timezone observes Daylight Saving Time at all."
        },
        "dst_tz_abbreviation": {
          "type": "string",
          "description": "Abbreviation of the DST timezone. Empty string if DST is not observed.\n"
        },
        "dst_tz_full_name": {
          "type": "string",
          "description": "Full name of the DST timezone. Empty string if DST is not observed.\n"
        },
        "dst_start": {
          "description": "Start DST transition details. When `dst_exists` is `false`, this is\nreturned as an empty object with no properties.\n",
          "oneOf": [
            {
              "$ref": "#/$defs/DstTransition"
            },
            {
              "type": "object",
              "maxProperties": 0
            }
          ]
        },
        "dst_end": {
          "description": "End DST transition details. When `dst_exists` is `false`, this is\nreturned as an empty object with no properties.\n",
          "oneOf": [
            {
              "$ref": "#/$defs/DstTransition"
            },
            {
              "type": "object",
              "maxProperties": 0
            }
          ]
        }
      }
    },
    "UserAgent": {
      "type": "object",
      "description": "Parsed User-Agent information. Only returned when `include=user_agent` or\n`include=*` is used. The API parses the `User-Agent` header from the request.\nFor server-side usage, forward your visitor's User-Agent string in the header.\n",
      "properties": {
        "user_agent_string": {
          "type": "string",
          "description": "The raw User-Agent string that was parsed."
        },
        "name": {
          "type": "string",
          "description": "Detected browser or client name."
        },
        "type": {
          "type": "string",
          "description": "Client type classification. Common values: `Browser`, `Robot`,\n`Mobile Browser`, `Library`.\n"
        },
        "version": {
          "type": "string",
          "description": "Full version string of the detected client."
        },
        "version_major": {
          "type": "string",
          "description": "Major version number of the detected client."
        },
        "device": {
          "$ref": "#/$defs/UserAgentDevice"
        },
        "engine": {
          "$ref": "#/$defs/UserAgentEngine"
        },
        "operating_system": {
          "$ref": "#/$defs/UserAgentOperatingSystem"
        }
      }
    },
    "UserAgentDevice": {
      "type": "object",
      "description": "Device information extracted from the User-Agent string.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Device name or model."
        },
        "type": {
          "type": "string",
          "description": "Device type. Common values: `Desktop`, `Smartphone`, `Tablet`, `Robot`,\n`Smart TV`.\n"
        },
        "brand": {
          "type": "string",
          "description": "Device manufacturer or brand. `Unknown` if not detectable."
        },
        "cpu": {
          "type": "string",
          "description": "CPU architecture if detectable (e.g. `Intel x86_64`, `ARM`). `Unknown` otherwise."
        }
      }
    },
    "UserAgentEngine": {
      "type": "object",
      "description": "Rendering engine information extracted from the User-Agent string.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Engine name (e.g. `Blink`, `Gecko`, `WebKit`)."
        },
        "type": {
          "type": "string",
          "description": "Engine classification. Typically matches the client type."
        },
        "version": {
          "type": "string",
          "description": "Full version of the rendering engine."
        },
        "version_major": {
          "type": "string",
          "description": "Major version of the rendering engine."
        }
      }
    },
    "UserAgentOperatingSystem": {
      "type": "object",
      "description": "Operating system information extracted from the User-Agent string.",
      "properties": {
        "name": {
          "type": "string",
          "description": "OS name (e.g. `Windows`, `macOS`, `Linux`, `Android`, `iOS`, `Cloud`)."
        },
        "type": {
          "type": "string",
          "description": "OS type. Common values: `Desktop`, `Mobile`, `Tablet`, `Cloud`.\n"
        },
        "version": {
          "type": "string",
          "description": "OS version. `??` when the version cannot be determined."
        },
        "version_major": {
          "type": "string",
          "description": "OS major version. `??` when the version cannot be determined."
        },
        "build": {
          "type": "string",
          "description": "OS build number. `??` when the build cannot be determined."
        }
      }
    }
  }
}