get location from ip code example

Example 1: ip lookup

$ curl "http://restapi.neoistone.com/v2/whois/ip/your-ip-addresh"

{
"error": false,
"code": 200,
"message": "ip was found ",
"data": {
"continent": "Asia",
"continent_code": "AS",
"country": "India",
"country_code": "IN",
"regionName": "Telangana",
"region": "TG",
"city": "Khammam",
"postal_code": "507001",
"lat": 17.2531,
"lon": 80.1421,
"location": "https://www.google.com/maps/dir/?api=1&destination=17.2531,80.1421",
"flag": "https://www.countryflags.io/IN/shiny/64.png",
"timezone": "Asia/Kolkata",
"currency": "INR",
"isp": "Tri-Networks",
"org": "Pioneer Elabs Ltd",
"as": "AS18229 CtrlS Datacenters Ltd.",
"asname": "CTRLS-AS-IN",
"mobile": false,
"proxy": false,
"hosting": true,
"tor": false,
"ip": "45.127.56.230",
"hostname": "45-127-56-230.ips.neoistone.com"
}
}

Example 2: ip lockup

$ curl "https://api.ip2location.com/v2/?ip=182.1.74.0&key={YOUR_API_KEY}&package=WS24&addon=continent,country,region,city,geotargeting,country_groupings,time_zone_info"

{
    "country_code": "ID",
    "country_name": "Indonesia",
    "region_name": "Jawa Timur",
    "city_name": "Surabaya",
    "latitude": "-7.24917",
    "longitude": "112.75083",
    "zip_code": "60135",
    "time_zone": "+07:00",
    "isp": "PT Telekomunikasi Selular Indonesia",
    "domain": "telkomsel.com",
    "net_speed": "DSL",
    "idd_code": "62",
    "area_code": "031",
    "weather_station_code": "IDXX0052",
    "weather_station_name": "Surabaya",
    "mcc": "510",
    "mnc": "10",
    "mobile_brand": "Telkomsel",
    "elevation": "6",
    "usage_type": "MOB",
    "credits_consumed": 33,
    "continent": {
        "name": "Asia",
        "code": "AS",
        "hemisphere": [
            "south",
            "east"
        ],
        "translations": []
    },
    "country": {
        "name": "Indonesia",
        "alpha3_code": "IDN",
        "numeric_code": "360",
        "demonym": "Indonesians",
        "flag": "https:\/\/cdn.ip2location.com\/assets\/img\/flags\/id.png",
        "capital": "Jakarta",
        "total_area": "1904569",
        "population": "266794980",
        "currency": {
            "code": "IDR",
            "name": "Indonesian Rupiah",
            "symbol": "Rp"
        },
        "language": {
            "code": "ID",
            "name": "Indonesian"
        },
        "idd_code": "62",
        "tld": "id",
        "translations": []
    },
    "region": {
        "name": "Jawa Timur",
        "code": "08",
        "translations": []
    },
    "city": {
        "name": "Surabaya",
        "translations": []
    },
    "geotargeting": {
        "metro": "602"
    },
    "country_groupings": [
        {
            "acronym": "APAC",
            "name": "Asia-Pacific"
        },
        {
            "acronym": "APEC",
            "name": "Asia-Pacific Economic Cooperation"
        },
        {
            "acronym": "ASEAN",
            "name": "Association of Southeast Asian Nations"
        },
        {
            "acronym": "CIVETS",
            "name": "Central and Eastern Europe"
        },
        {
            "acronym": "CPLP",
            "name": "Community of Portuguese Language Countries"
        },
        {
            "acronym": "G20",
            "name": "Group of Twenty"
        },
        {
            "acronym": "G77",
            "name": "Group of 77"
        },
        {
            "acronym": "MIKTA",
            "name": "Mexico, Indonesia, Republic of Korea, Turkey and Australia"
        },
        {
            "acronym": "MINT",
            "name": "Mexico, Indonesia, Nigeria, and Turkey"
        },
        {
            "acronym": "RCEP",
            "name": "Regional Comprehensive Economic Partnership"
        },
        {
            "acronym": "SEA",
            "name": "South-East Asia"
        },
        {
            "acronym": "UN",
            "name": "United Nations"
        },
        {
            "acronym": "VISTA",
            "name": "Vietnam, Indonesia, South Africa, Turkey and Argentina"
        }
    ],
    "time_zone_info": {
        "olson": "Asia\/Jakarta",
        "current_time": "2021-02-07T19:31:49+07:00",
        "gmt_offset": 25200,
        "is_dst": "no",
        "sunrise": "05:31",
        "sunset": "17:54"
    }
}

Tags:

Misc Example