Unable to get the data from the API

I want to make an IP address checker app. Before making the design part, I want to check if the API is working or not, so I use a simple design and do most of the work in the block part.
I get some of the data from the API, but most of them I am unable to get.

API link: http://api.ipapi.com/check?access_key=a8799a46de82fcd05de33c0117595d40

Example API Response:

{
“ip”: “161.185.160.93”,
“hostname”: “161.185.160.93”,
“type”: “ipv4”,
“continent_code”: “NA”,
“continent_name”: “North America”,
“country_code”: “US”,
“country_name”: “United States”,
“region_code”: “NY”,
“region_name”: “New York”,
“city”: “Brooklyn”,
“zip”: “11238”,
“latitude”: 40.676,
“longitude”: -73.9629,
“location”: {
“geoname_id”: 5110302,
“capital”: “Washington D.C.”,
“languages”: [
{
“code”: “en”,
“name”: “English”,
“native”: “English”
}
],
“country_flag”: “http://assets.ipapi.com/flags/us.svg”,
“country_flag_emoji”: “:us:”,
“country_flag_emoji_unicode”: “U+1F1FA U+1F1F8”,
“calling_code”: “1”,
“is_eu”: false
},
“time_zone”: {
“id”: “America/New_York”,
“current_time”: “2018-09-24T05:07:10-04:00”,
“gmt_offset”: -14400,
“code”: “EDT”,
“is_daylight_saving”: true
},
“currency”: {
“code”: “USD”,
“name”: “US Dollar”,
“plural”: “US dollars”,
“symbol”: “$”,
“symbol_native”: “$”
},
“connection”: {
“asn”: 22252,
“isp”: “The City of New York”
},
“security”: {
“is_proxy”: false,
“proxy_type”: null,
“is_crawler”: false,
“crawler_name”: null,
“crawler_type”: null,
“is_tor”: false,
“threat_level”: “low”,
“threat_types”: null
}
}

App screenshot:-

Aia file:

testip.aia (314.1 KB)

Post your relevant blocks instead of posting an aia file (especially one that is zipped and thus wasting people’s time).

testip.aia (314.1 KB)

Read again api’s documentation, this is what you get with the specific url for example no hostname so result is not found

{
    "ip": "161.185.160.93",
    "type": "ipv4",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_code": "US",
    "country_name": "United States",
    "region_code": "NY",
    "region_name": "New York",
    "city": "Brooklyn",
    "zip": "11238",
    "latitude": 40.676,
    "longitude": -73.9629,
    "location": {
        "geoname_id": 5110302,
        "capital": "Washington D.C.",
        "languages": [
            {
                "code": "en",
                "name": "English",
                "native": "English"
            }
        ],
        "country_flag": "http://assets.ipapi.com/flags/us.svg",
        "country_flag_emoji": "🇺🇸",
        "country_flag_emoji_unicode": "U+1F1FA U+1F1F8",
        "calling_code": "1",
        "is_eu": false
    },
    "time_zone": {
        "id": "America/New_York",
        "current_time": "2018-09-24T05:07:10-04:00",
        "gmt_offset": -14400,
        "code": "EDT",
        "is_daylight_saving": true
    },
    "currency": {
        "code": "USD",
        "name": "US Dollar",
        "plural": "US dollars",
        "symbol": "$",
        "symbol_native": "$"
    },
    "connection": {
        "asn": 22252,
        "isp": "The City of New York"
    }

This is an example, you don’t get that in your app because it requires hostname lookup to be enabled.

Simply go the the url you provided and see what you actually get as json response

In order to get hostname for example url should be

http://api.ipapi.com/check?access_key=your_key_here&hostname=1

How can I call this?

This is an array, using [Free] Json To Dictionary Extension

You should study json next time

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.