{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ip2location/json-schema/ip2location-ipgeolocation-response-schema.json",
  "title": "IPGeolocationResponse",
  "description": "Geolocation record for one IP address. Fields appear according to the plan; only `ip` is always present.",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ip2location-ip-geolocation-openapi.yml#/components/schemas/IPGeolocationResponse",
  "type": "object",
  "required": [
    "ip"
  ],
  "properties": {
    "message": {
      "type": "string",
      "description": "Informational message returned only to keyless requests, for example the daily limit notice."
    },
    "ip": {
      "type": "string",
      "format": "ip",
      "description": "IP address that was looked up."
    },
    "country_code": {
      "type": "string",
      "description": "Two-character country code based on ISO 3166."
    },
    "country_name": {
      "type": "string",
      "description": "Country name based on ISO 3166."
    },
    "region_name": {
      "type": "string",
      "description": "Region or state name."
    },
    "district": {
      "type": "string",
      "description": "District or county name. Available on the Security plan."
    },
    "city_name": {
      "type": "string",
      "description": "City name."
    },
    "latitude": {
      "type": "number",
      "description": "City latitude. Defaults to the capital city latitude when the city is unknown."
    },
    "longitude": {
      "type": "number",
      "description": "City longitude. Defaults to the capital city longitude when the city is unknown."
    },
    "zip_code": {
      "type": "string",
      "description": "ZIP or postal code."
    },
    "time_zone": {
      "type": "string",
      "description": "UTC time zone with daylight saving time applied."
    },
    "asn": {
      "type": "string",
      "description": "Autonomous system number (ASN)."
    },
    "as": {
      "type": "string",
      "description": "Autonomous system (AS) name."
    },
    "as_info": {
      "$ref": "#/$defs/ASInfo"
    },
    "isp": {
      "type": "string",
      "description": "Internet Service Provider or company name. Available on the Starter plan and above."
    },
    "domain": {
      "type": "string",
      "description": "Internet domain name associated with the IP address range. Available on the Starter plan and above."
    },
    "net_speed": {
      "type": "string",
      "enum": [
        "DIAL",
        "DSL",
        "COMP",
        "T1",
        "SAT"
      ],
      "description": "Internet connection type. DIAL = dial-up, DSL = broadband/cable/fibre/mobile, COMP = corporate, T1 = data centre/transit, SAT = satellite. Available on the Starter plan and above."
    },
    "idd_code": {
      "type": "string",
      "description": "IDD prefix used to call the city from another country. Available on the Starter plan and above."
    },
    "area_code": {
      "type": "string",
      "description": "Area code for calls between cities. Available on the Starter plan and above."
    },
    "weather_station_code": {
      "type": "string",
      "description": "Code of the nearest weather observation station. Available on the Starter plan and above."
    },
    "weather_station_name": {
      "type": "string",
      "description": "Name of the nearest weather observation station. Available on the Starter plan and above."
    },
    "mcc": {
      "type": [
        "string",
        "null"
      ],
      "description": "Mobile Country Code (ITU E.212). \"-\" in the single-IP API and null in the Bulk API when unknown. Available on the Plus plan and above."
    },
    "mnc": {
      "type": [
        "string",
        "null"
      ],
      "description": "Mobile Network Code. \"-\" in the single-IP API and null in the Bulk API when unknown. Available on the Plus plan and above."
    },
    "mobile_brand": {
      "type": [
        "string",
        "null"
      ],
      "description": "Commercial brand associated with the mobile carrier. \"-\" in the single-IP API and null in the Bulk API when unknown. Available on the Plus plan and above."
    },
    "elevation": {
      "type": "number",
      "description": "Average height of the city above sea level, in metres. Available on the Starter plan and above."
    },
    "usage_type": {
      "type": "string",
      "enum": [
        "COM",
        "ORG",
        "GOV",
        "MIL",
        "EDU",
        "LIB",
        "CDN",
        "ISP",
        "MOB",
        "DCH",
        "SES",
        "AIC",
        "RSV",
        "ISP/MOB"
      ],
      "description": "Usage type classification of the ISP or company. Available on the Starter plan and above."
    },
    "address_type": {
      "type": "string",
      "enum": [
        "Anycast",
        "Unicast",
        "Multicast",
        "Broadcast"
      ],
      "description": "IP address type. Available on the Plus plan and above."
    },
    "ads_category": {
      "type": "string",
      "description": "Domain category code based on the IAB Tech Lab Content Taxonomy v3.1. Available on the Security plan."
    },
    "ads_category_name": {
      "type": "string",
      "description": "Domain category name based on the IAB Tech Lab Content Taxonomy v3.1, or \"-\" when unclassified. Available on the Security plan."
    },
    "continent": {
      "$ref": "#/$defs/Continent"
    },
    "country": {
      "$ref": "#/$defs/Country"
    },
    "region": {
      "$ref": "#/$defs/Region"
    },
    "city": {
      "$ref": "#/$defs/City"
    },
    "time_zone_info": {
      "$ref": "#/$defs/TimeZoneInfo"
    },
    "geotargeting": {
      "$ref": "#/$defs/Geotargeting"
    },
    "is_proxy": {
      "type": "boolean",
      "description": "Whether the address belongs to a known proxy, VPN, Tor exit node or another masking service."
    },
    "fraud_score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99,
      "description": "IP2Proxy fraud score from 0 to 99. A higher score means a greater likelihood of fraudulent activity. Available on the Security plan."
    },
    "proxy": {
      "$ref": "#/$defs/Proxy"
    }
  },
  "$defs": {
    "ASInfo": {
      "type": "object",
      "description": "Autonomous System details. Available on the Security plan.",
      "properties": {
        "as_number": {
          "type": "string",
          "description": "Autonomous system number (ASN)."
        },
        "as_name": {
          "type": "string",
          "description": "Autonomous system (AS) name."
        },
        "as_domain": {
          "type": "string",
          "description": "Domain name of the AS registrant."
        },
        "as_usage_type": {
          "type": "string",
          "enum": [
            "COM",
            "ORG",
            "GOV",
            "MIL",
            "EDU",
            "LIB",
            "CDN",
            "ISP",
            "MOB",
            "DCH",
            "SES",
            "AIC",
            "RSV",
            "ISP/MOB"
          ],
          "description": "Usage type of the AS registrant."
        },
        "as_cidr": {
          "type": "string",
          "description": "CIDR range for the whole AS."
        }
      }
    },
    "City": {
      "type": "object",
      "description": "City details. Available on the Plus and Security plans.",
      "properties": {
        "name": {
          "type": "string",
          "description": "City name."
        },
        "translation": {
          "type": "object",
          "description": "Translation of the name for the language requested with the `lang` parameter. Both values are null when no translation is available, for example for city names.",
          "properties": {
            "lang": {
              "type": [
                "string",
                "null"
              ]
            },
            "value": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "Continent": {
      "type": "object",
      "description": "Continent details. Available on the Plus and Security plans.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Continent name."
        },
        "code": {
          "type": "string",
          "enum": [
            "AF",
            "AN",
            "AS",
            "EU",
            "NA",
            "OC",
            "SA"
          ],
          "description": "Two-character continent code."
        },
        "hemisphere": {
          "type": "array",
          "description": "The hemisphere where the country is located. The first item is the north/south hemisphere and the second item is the east/west hemisphere.",
          "items": {
            "type": "string",
            "enum": [
              "north",
              "south",
              "east",
              "west"
            ]
          }
        },
        "translation": {
          "type": "object",
          "description": "Translation of the name for the language requested with the `lang` parameter. Both values are null when no translation is available, for example for city names.",
          "properties": {
            "lang": {
              "type": [
                "string",
                "null"
              ]
            },
            "value": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "Country": {
      "type": "object",
      "description": "Country details. Available on the Plus and Security plans.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Country name based on ISO 3166."
        },
        "alpha3_code": {
          "type": "string",
          "description": "Three-character country code based on ISO 3166."
        },
        "numeric_code": {
          "type": [
            "integer",
            "string"
          ],
          "description": "ISO 3166-1 numeric country code. The single-IP API returns an integer; the Bulk API returns the same value as a numeric string."
        },
        "demonym": {
          "type": "string",
          "description": "Native of the country."
        },
        "flag": {
          "type": "string",
          "format": "uri",
          "description": "URL of the country flag image."
        },
        "capital": {
          "type": "string",
          "description": "Capital of the country."
        },
        "total_area": {
          "type": "number",
          "description": "Total area in square kilometres."
        },
        "population": {
          "type": "integer",
          "description": "Population of the country."
        },
        "currency": {
          "type": "object",
          "description": "Currency of the country.",
          "properties": {
            "code": {
              "type": "string",
              "description": "ISO 4217 currency code."
            },
            "name": {
              "type": "string",
              "description": "Currency name."
            },
            "symbol": {
              "type": "string",
              "description": "Currency symbol."
            }
          }
        },
        "language": {
          "type": "object",
          "description": "Primary language of the country.",
          "properties": {
            "code": {
              "type": "string",
              "description": "Language code."
            },
            "name": {
              "type": "string",
              "description": "Language name."
            }
          }
        },
        "tld": {
          "type": "string",
          "description": "Country-code top-level domain."
        },
        "translation": {
          "type": "object",
          "description": "Translation of the name for the language requested with the `lang` parameter. Both values are null when no translation is available, for example for city names.",
          "properties": {
            "lang": {
              "type": [
                "string",
                "null"
              ]
            },
            "value": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "Geotargeting": {
      "type": "object",
      "description": "Geotargeting data. Available on the Plus and Security plans.",
      "properties": {
        "metro": {
          "type": [
            "string",
            "null"
          ],
          "description": "Metro code based on the ZIP or postal code, or null when the address is outside a metered area."
        }
      }
    },
    "Proxy": {
      "type": "object",
      "description": "Proxy and threat details. The full object is available on the Security plan; lower plans only return `is_proxy`.",
      "properties": {
        "last_seen": {
          "type": "integer",
          "description": "Number of days since the proxy was last seen."
        },
        "proxy_type": {
          "type": "string",
          "enum": [
            "VPN",
            "TOR",
            "DCH",
            "PUB",
            "WEB",
            "SES",
            "AIC",
            "RES",
            "CPN",
            "EPN"
          ],
          "description": "Type of proxy."
        },
        "threat": {
          "type": "string",
          "description": "Security threats reported for the address as a slash-separated list: SPAM, SCANNER, BOTNET and BOGON. \"-\" when none apply."
        },
        "provider": {
          "type": "string",
          "description": "Name of the VPN provider, when available."
        },
        "is_vpn": {
          "type": "boolean",
          "description": "Anonymising VPN service."
        },
        "is_tor": {
          "type": "boolean",
          "description": "Tor exit node."
        },
        "is_data_center": {
          "type": "boolean",
          "description": "Hosting provider, data centre or content delivery network."
        },
        "is_public_proxy": {
          "type": "boolean",
          "description": "Public proxy."
        },
        "is_web_proxy": {
          "type": "boolean",
          "description": "Web proxy."
        },
        "is_web_crawler": {
          "type": "boolean",
          "description": "Search engine robot."
        },
        "is_ai_crawler": {
          "type": "boolean",
          "description": "Crawler operated by an AI company to collect training data or support retrieval."
        },
        "is_residential_proxy": {
          "type": "boolean",
          "description": "Residential proxy."
        },
        "is_spammer": {
          "type": "boolean",
          "description": "Email or forum spammer."
        },
        "is_scanner": {
          "type": "boolean",
          "description": "Network security scanner."
        },
        "is_botnet": {
          "type": "boolean",
          "description": "Malware-infected device."
        },
        "is_bogon": {
          "type": "boolean",
          "description": "Unassigned or illegitimate address announced via BGP."
        },
        "is_consumer_privacy_network": {
          "type": "boolean",
          "description": "Consumer privacy network."
        },
        "is_enterprise_private_network": {
          "type": "boolean",
          "description": "Enterprise private network."
        }
      }
    },
    "Region": {
      "type": "object",
      "description": "Region details. Available on the Plus and Security plans.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Region or state name."
        },
        "code": {
          "type": "string",
          "description": "ISO 3166-2 code."
        },
        "translation": {
          "type": "object",
          "description": "Translation of the name for the language requested with the `lang` parameter. Both values are null when no translation is available, for example for city names.",
          "properties": {
            "lang": {
              "type": [
                "string",
                "null"
              ]
            },
            "value": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "TimeZoneInfo": {
      "type": "object",
      "description": "Detailed time zone information. Available on the Plus and Security plans.",
      "properties": {
        "olson": {
          "type": "string",
          "description": "Time zone in Olson format."
        },
        "current_time": {
          "type": "string",
          "format": "date-time",
          "description": "Current local time in ISO 8601 format."
        },
        "gmt_offset": {
          "type": "integer",
          "description": "GMT offset in seconds."
        },
        "is_dst": {
          "type": "boolean",
          "description": "Whether the time zone is currently observing daylight saving time."
        },
        "abbreviation": {
          "type": "string",
          "description": "Time zone abbreviation, for example EST or PDT."
        },
        "dst_start_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Date on which daylight saving time starts, or null in a time zone without DST."
        },
        "dst_end_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Date on which daylight saving time ends, or null in a time zone without DST."
        },
        "sunrise": {
          "type": "string",
          "description": "Sunrise time in local time (hh:mm)."
        },
        "sunset": {
          "type": "string",
          "description": "Sunset time in local time (hh:mm)."
        }
      }
    }
  }
}