{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ipfly-world/json-schema/ipfly-world-geo-record-schema.json",
  "title": "GeoRecord",
  "description": "The resolved address. Which fields are present depends on the plan and on the `include` parameter. A plan that unlocks no field group at all returns an empty object.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ipfly-world-openapi.json#/components/schemas/GeoRecord",
  "type": "object",
  "required": [
    "ip"
  ],
  "properties": {
    "ip": {
      "type": "string",
      "description": "The queried IP address."
    },
    "hostname": {
      "type": "string",
      "description": "Reverse DNS hostname of the address."
    },
    "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 name of the country."
    },
    "country_capital": {
      "type": "string",
      "description": "Capital city of the country."
    },
    "state_prov": {
      "type": "string",
      "description": "State, province or region name."
    },
    "state_code": {
      "type": "string",
      "description": "State or province code."
    },
    "district": {
      "type": "string",
      "description": "District or sub-region."
    },
    "city": {
      "type": "string",
      "description": "City name."
    },
    "zipcode": {
      "type": "string",
      "description": "ZIP or postal code."
    },
    "latitude": {
      "type": "string",
      "description": "Latitude coordinate."
    },
    "longitude": {
      "type": "string",
      "description": "Longitude coordinate."
    },
    "is_eu": {
      "type": "boolean",
      "description": "Whether the country is a member of the European Union."
    },
    "country_emoji": {
      "type": "string",
      "description": "Country flag emoji."
    },
    "calling_code": {
      "type": "string",
      "description": "International dialing code."
    },
    "country_tld": {
      "type": "string",
      "description": "Country code top-level domain."
    },
    "languages": {
      "type": "string",
      "description": "Official language or languages of the country."
    },
    "currency": {
      "$ref": "#/$defs/Currency"
    },
    "time_zone": {
      "$ref": "#/$defs/TimeZone"
    },
    "asn": {
      "$ref": "#/$defs/Asn"
    },
    "company": {
      "$ref": "#/$defs/Company"
    },
    "security": {
      "$ref": "#/$defs/Security"
    }
  },
  "$defs": {
    "Asn": {
      "type": "object",
      "description": "Autonomous system the address is routed through. Returned on plans that include ASN data.",
      "properties": {
        "asn": {
          "type": "string",
          "description": "AS number."
        },
        "name": {
          "type": "string",
          "description": "Organization name."
        },
        "domain": {
          "type": "string",
          "description": "Organization's domain."
        },
        "route": {
          "type": "string",
          "description": "IP route or prefix in CIDR notation."
        },
        "type": {
          "type": "string",
          "description": "Network type. Usually one of isp, hosting, business or education."
        }
      }
    },
    "Blocklist": {
      "type": "object",
      "description": "A blocklist the address appears on.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the list."
        },
        "site": {
          "type": "string",
          "description": "Site publishing the list."
        }
      }
    },
    "Company": {
      "type": "object",
      "description": "Organisation that owns or operates the address. Returned on plans that include company data.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Company name."
        },
        "domain": {
          "type": "string",
          "description": "Company domain."
        },
        "type": {
          "type": "string",
          "description": "Company type. Usually one of isp, hosting, business or education."
        }
      }
    },
    "Currency": {
      "type": "object",
      "description": "Local currency of the country the address is located in.",
      "properties": {
        "code": {
          "type": "string",
          "description": "ISO 4217 currency code."
        },
        "name": {
          "type": "string",
          "description": "Currency name."
        },
        "symbol": {
          "type": "string",
          "description": "Currency symbol."
        }
      }
    },
    "Security": {
      "type": "object",
      "description": "Threat intelligence and anonymisation flags. Returned only when `include=security` is sent and the plan unlocks the group. Treat these as signals, not verdicts — false positives on shared corporate NATs and mobile carrier gateways are common.",
      "properties": {
        "is_tor": {
          "type": "boolean",
          "description": "Whether the address is a Tor exit node."
        },
        "is_vpn": {
          "type": "boolean",
          "description": "Whether the address is used for a VPN."
        },
        "is_icloud_relay": {
          "type": "boolean",
          "description": "Whether the address is an iCloud Apple relay."
        },
        "is_proxy": {
          "type": "boolean",
          "description": "Whether the address is a known proxy."
        },
        "is_datacenter": {
          "type": "boolean",
          "description": "Whether the address belongs to a datacenter allocation."
        },
        "is_anonymous": {
          "type": "boolean",
          "description": "Whether the address is used for anonymisation."
        },
        "is_known_attacker": {
          "type": "boolean",
          "description": "Whether the address is used for DoS attacks or floods."
        },
        "is_known_abuser": {
          "type": "boolean",
          "description": "Whether the address is used for abuse such as hijacking or malware."
        },
        "is_threat": {
          "type": "boolean",
          "description": "Whether the address belongs to a high-risk threat network."
        },
        "is_bogon": {
          "type": "boolean",
          "description": "Whether the address belongs to a bogon CIDR range."
        },
        "blocklists": {
          "type": "array",
          "description": "Lists the address appears on.",
          "items": {
            "$ref": "#/$defs/Blocklist"
          }
        },
        "scores": {
          "$ref": "#/$defs/SecurityScores"
        }
      }
    },
    "SecurityScores": {
      "type": "object",
      "description": "Reputation scores for the address.",
      "properties": {
        "vpn_score": {
          "type": "number",
          "description": "VPN score."
        },
        "proxy_score": {
          "type": "number",
          "description": "Proxy score."
        },
        "threat_score": {
          "type": "number",
          "description": "Threat score."
        },
        "trust_score": {
          "type": "number",
          "description": "Trust score."
        }
      }
    },
    "TimeZone": {
      "type": "object",
      "description": "Current time and timezone data for the location of the address.",
      "properties": {
        "name": {
          "type": "string",
          "description": "IANA timezone name."
        },
        "offset": {
          "type": "number",
          "description": "UTC offset in hours, without daylight saving time."
        },
        "offset_with_dst": {
          "type": "number",
          "description": "UTC offset in hours, including daylight saving time."
        },
        "current_time": {
          "type": "string",
          "description": "Current local time."
        },
        "current_time_unix": {
          "type": "number",
          "description": "Current local time as a Unix timestamp."
        },
        "current_tz_abbreviation": {
          "type": "string",
          "description": "Timezone abbreviation."
        },
        "current_tz_full_name": {
          "type": "string",
          "description": "Full timezone name."
        },
        "is_dst": {
          "type": "boolean",
          "description": "Whether daylight saving time is currently active."
        }
      }
    }
  }
}