{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geoapify/json-schema/geoapify-ip-geolocation-response-schema.json",
  "title": "IpGeolocationResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geoapify-ip-geolocation-api-openapi.yml#/components/schemas/IpGeolocationResponse",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "ip": {
      "type": "string",
      "anyOf": [
        {
          "format": "ipv4"
        },
        {
          "format": "ipv6"
        }
      ]
    },
    "city": {
      "$ref": "#/$defs/IpGeolocationNamedEntity"
    },
    "state": {
      "$ref": "#/$defs/IpGeolocationNamedEntity"
    },
    "country": {
      "$ref": "#/$defs/IpGeolocationCountry"
    },
    "continent": {
      "$ref": "#/$defs/IpGeolocationContinent"
    },
    "location": {
      "$ref": "#/$defs/IpGeolocationLocation"
    },
    "subdivisions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IpGeolocationNamedEntity"
      }
    },
    "postal": {
      "$ref": "#/$defs/IpGeolocationPostal"
    }
  },
  "$defs": {
    "IpGeolocationContinent": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "names": {
          "$ref": "#/$defs/LocalizedNames"
        },
        "geoname_id": {
          "type": "integer"
        }
      }
    },
    "IpGeolocationCountry": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string"
        },
        "iso_code": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "names": {
          "$ref": "#/$defs/LocalizedNames"
        },
        "geoname_id": {
          "type": "integer"
        },
        "name_native": {
          "type": "string"
        },
        "phone_code": {
          "type": "string"
        },
        "capital": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "flag": {
          "type": "string"
        },
        "languages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IpGeolocationLanguage"
          }
        }
      }
    },
    "IpGeolocationLanguage": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "iso_code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "name_native": {
          "type": "string"
        }
      }
    },
    "IpGeolocationLocation": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "minimum": -90,
          "maximum": 90
        },
        "longitude": {
          "type": "number",
          "minimum": -180,
          "maximum": 180
        }
      }
    },
    "IpGeolocationNamedEntity": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string"
        },
        "names": {
          "$ref": "#/$defs/LocalizedNames"
        }
      }
    },
    "IpGeolocationPostal": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": "string"
        }
      }
    },
    "LocalizedNames": {
      "type": "object",
      "description": "Names keyed by language code.",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}