DEV Community

PIPO
PIPO

Posted on

Notes about Geolocation/IPGeolocation

Notes about Geolocation

There are several providers who offer this "service"... Geolocation from an IP.

I'm gonna resume some few services, and a basic usage of them, just to help others to know how to use the IP Geolocation and what it offers.

Summary

my-ip.io

Service BIO:

FREE EndPoints

My IP

Sample Request
# PowerShell Clear-Host; $RootURL = "https://api.my-ip.io"; $BaseURL = "${RootURL}/v2/ip.json"; ## My IP $MyIpioInfo = IRM "${BaseURL}"; $MyIpioInfo; $MyIpioInfo | ConvertTo-Json -Depth 9; $MyIpioIP = $MyIpioInfo.ip; $MyIpioIP; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "success": true, "ip": "[MY_IP]", "type": "IPv4", "country": { "code": "[MY_COUNTRY_CODE]", "name": "[MY_COUNTRY_NAME]" }, "region": "[MY_REGION]", "city": "[MY_CITY]", "location": { "lat": [MY_LATITUDE_SHORT], "lon": [MY_LONGITUDE_SHORT] }, "timeZone": "[MY_TIMEZONE]", "asn": { "number": [MY_ASN], "name": "[MY_ASN_NAME]", "network": "[MY_ASN_NETWORK]" } } 
Enter fullscreen mode Exit fullscreen mode

api-bdc.net / bigdatacloud.com

Service BIO:

FREE EndPoints

Client IP

Sample Request
# PowerShell Clear-Host; $BaseURL = "https://api-bdc.net"; $Response = IRM "${BaseURL}/data/client-ip" $Response; $Response | ConvertTo-Json -Depth 9; ## My IP $MyBDCClientIP = $Response.ipString; $MyBDCClientIP; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ipString": "[MY_IP]", "ipType": "IPv4" } 
Enter fullscreen mode Exit fullscreen mode

Client Info

Sample Request
# PowerShell Clear-Host; $BaseURL = "https://api-bdc.net"; $MyBDCClientInfo = IRM "${BaseURL}/data/client-info" $MyBDCClientInfo; $MyBDCClientInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ipString": "[MY_IP]", "ipNumeric": [MY_NUMERIC_IP], "ipType": "IPv4", "isBehindProxy": false, "device": "Desktop", "os": "Windows 10", "userAgent": "WindowsPowerShell 5.1.22621", "family": "WindowsPowerShell", "versionMajor": "5", "versionMinor": "1", "versionPatch": "22621", "isSpider": false, "isMobile": false, "userAgentDisplay": "Windows 10 Desktop WindowsPowerShell 5.1.22621", "userAgentRaw": "Mozilla/5.0 (Windows NT; Windows NT 10.0; es-ES) WindowsPowerShell/5.1.22621.4391" } 
Enter fullscreen mode Exit fullscreen mode

Reverse Geocode

Sample Request
# PowerShell Clear-Host; $BaseURL = "https://api-bdc.net"; $MyBDCRevGeoInfo = IRM "${BaseURL}/data/reverse-geocode-client?localityLanguage=es" $MyBDCRevGeoInfo; $MyBDCRevGeoInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "latitude": [MY_LATITUDE], "lookupSource": "ip geolocation", "longitude": [MY_LONGITUDE], "localityLanguageRequested": "[MY_COUNTRY_CODE]", "continent": "Europa", "continentCode": "EU", "countryName": "[MY_COUNTRY_NAME]", "countryCode": "[MY_COUNTRY_CODE]", "principalSubdivision": "[MY_REGION]", "principalSubdivisionCode": "[MY_REGION_CODE]", "city": "[MY_CITY]", "locality": "[MY_LOCALITY]", "postcode": "", "plusCode": "[MY_PLUS_CODE]", "localityInfo": { "administrative": [ { "name": "[MY_COUNTRY_NAME]", "description": "pa\u00eds del suroeste de Europa", "isoName": "[MY_COUNTRY_ISO_NAME]", "order": 2, "adminLevel": 2, "isoCode": "[MY_COUNTRY_ISO_CODE]", "wikidataId": "[MY_WIKIDATA_ID]", "geonameId": [MY_GEONAME_ID] }, {...}, {...} ], "informative": [ { "name": "Europa", "description": "continente ba\u00f1ado principalmente por el Atl\u00e1ntico", "isoName": "Europe", "order": 1, "isoCode": "EU", "wikidataId": "Q46", "geonameId": 6255148 }, {...} ] } } 
Enter fullscreen mode Exit fullscreen mode

Roaming

Requires latitude and longitude.
Afortunatelly, we can get those values from the previous call.

Sample Request
# PowerShell Clear-Host; $BaseURL = "https://api-bdc.net"; $MyBDCRevGeoInfo = IRM "${BaseURL}/data/reverse-geocode-client" $MyBDCLatitude = $MyBDCRevGeoInfo.latitude; $MyBDCLongitude = $MyBDCRevGeoInfo.longitude; $MyBDCRoamingInfo = IRM "${BaseURL}/data/am-i-roaming?latitude=${MyBDCLatitude}&longitude=${MyBDCLongitude}" $MyBDCRoamingInfo; $MyBDCRoamingInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "isRoaming": false } 
Enter fullscreen mode Exit fullscreen mode

APIKey EndPoints

IP Geolocation FULL

Availables here: https://www.bigdatacloud.com/ip-geolocation
Requires an APIKey.

Sample Request
# PowerShell Clear-Host; $MyBDCAPIKey = "[MY_BDC_API_KEY]"; $RootURL = "https://api-bdc.net"; $BaseURL = "${RootURL}/data"; $MyBDCGeoLocFULL = IRM "${BaseURL}/ip-geolocation-full?key=${MyBDCAPIKey}&localityLanguage=es" $MyBDCGeoLocFULL; $MyBDCGeoLocFULL | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]", "localityLanguageRequested": "[MY_COUNTRY_CODE]", "isReachableGlobally": true, "country": { "isoAlpha2": "[MY_COUNTRY_ALPHA2_CODE]", "isoAlpha3": "[MY_COUNTRY_ALPHA3_CODE]", "m49Code": [MY_COUNTRY_M49_CODE], "name": "[MY_COUNTRY_NAME]", "isoName": "[MY_COUNTRY_ISO_NAME]", "isoNameFull": "[MY_COUNTRY_ISO_FULL_NAME]", "isoAdminLanguages": [ { "isoAlpha3": "[MY_LANGUAGE_ALPHA3_CODE]", "isoAlpha2": "[MY_LANGUAGE_ALPHA2_CODE]", "isoName": "[MY_LANGUAGE_ISO_NAME]", "nativeName": "[MY_LANGUAGE_NAME]" } ], "unRegion": "Europe and Northern America/Europe/Southern Europe", "currency": { "numericCode": 978, "code": "EUR", "name": "Euro", "minorUnits": 2 }, "wbRegion": { "id": "ECS", "iso2Code": "Z7", "value": "Europe & Central Asia" }, "wbIncomeLevel": { "id": "HIC", "iso2Code": "XD", "value": "High income" }, "callingCode": "[MY_COUNTRY_CALLING_CODE]", "countryFlagEmoji": "[MY_COUNTRY_FLAG_EMOJI]", "wikidataId": "[MY_WIKIDATA]", "geonameId": [MY_GEONAME_ID], "isIndependent": true }, "location": { "principalSubdivision": "[MY_REGION]", "isoPrincipalSubdivision": "[MY_REGION_ISO]", "isoPrincipalSubdivisionCode": "[MY_REGION_ISO_CODE]", "continent": "Europa", "continentCode": "EU", "city": "[MY_CITY]", "localityName": "[MY_LOCALITY]", "postcode": "", "latitude": [MY_LATITUDE_SHORT], "longitude": [MY_LONGITUDE_SHORT], "plusCode": "[MY_PLUS_CODE]", "timeZone": { "ianaTimeId": "[MY_TIMEZONE]", "displayName": "[MY_TIMEZONE_NAME]", "effectiveTimeZoneFull": "Central European Standard Time", "effectiveTimeZoneShort": "CET", "utcOffsetSeconds": 3600, "utcOffset": "+01", "isDaylightSavingTime": false, "localTime": "2025-02-01T10:21:36.9293308" }, "localityInfo": { "administrative": [ { "name": "[MY_COUNTRY_NAME]", "description": "pa\u00eds del suroeste de Europa", "isoName": "[MY_COUNTRY_ISO_NAME]", "order": 2, "adminLevel": 2, "isoCode": "[MY_COUNTRY_CODE]", "wikidataId": "Q29", "geonameId": 2510769 }, {...}, {...} ], "informative": [ { "name": "Europa", "description": "continente ba\u00f1ado principalmente por el Atl\u00e1ntico", "isoName": "Europe", "order": 1, "isoCode": "EU", "wikidataId": "Q46", "geonameId": 6255148 }, {...}, {...} ] } }, "lastUpdated": "2025-02-01T04:44:13.6068279Z", "network": { "registry": "RIPE", "registryStatus": "assigned", "registeredCountry": "[MY_COUNTRY_CODE]", "registeredCountryName": "[MY_COUNTRY_NAME]", "organisation": "[MY_CARRIER]", "isReachableGlobally": true, "isBogon": false, "bgpPrefix": "[MY_CARRIER_PREFIX]", "bgpPrefixNetworkAddress": "[MY_CARRIER_NET_ADDRESS]", "bgpPrefixLastAddress": "[MY_CARRIER_LAST_ADDRESS]", "totalAddresses": 4096, "carriers": [ {...info about carriers...} ], "viaCarriers": [ {...info about via carrier...}, {...info about via carrier...}, {...info about via carrier...} ] }, "confidence": "high", "confidenceArea": [ // Array of points delimiting an area { "latitude": [LATITUDE], "longitude": [LONGITUDE] } ], "securityThreat": "unknown", "hazardReport": { "isKnownAsTorServer": false, "isKnownAsVpn": false, "isKnownAsProxy": false, "isSpamhausDrop": false, "isSpamhausEdrop": false, "isSpamhausAsnDrop": false, "isBlacklistedUceprotect": false, "isBlacklistedBlocklistDe": false, "isKnownAsMailServer": false, "isKnownAsPublicRouter": false, "isBogon": false, "isUnreachable": false, "hostingLikelihood": 0, "isHostingAsn": false, "isCellular": false, "iCloudPrivateRelay": false } } 
Enter fullscreen mode Exit fullscreen mode

Reverse Geocode Client

Availables here: https://www.bigdatacloud.com/reverse-geocoding
Requires an APIKey, the latitude and the longitude.
Afortunatelly, we can get those values from the previous call.

Sample Request
# PowerShell Clear-Host; $MyBDCAPIKey = "[MY_BDC_API_KEY]"; $RootURL = "https://api-bdc.net"; $BaseURL = "${RootURL}/data"; $MyBDCRevGeoClientInfo = IRM "${BaseURL}/reverse-geocode-with-timezone?key=${MyBDCAPIKey}&latitude=${MyBDCLatitude}&longitude=${MyBDCLongitude}&localityLanguage=es" $MyBDCRevGeoClientInfo; $MyBDCRevGeoClientInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "latitude": [MY_LATITUDE], "longitude": [MY_LONGITUDE], "localityLanguageRequested": "[MY_COUNTRY_CODE]", "continent": "Europa", "continentCode": "EU", "countryName": "[MY_COUNTRY_NAME]", "countryCode": "[MY_COUNTRY_CODE]", "principalSubdivision": "[MY_REGION]", "principalSubdivisionCode": "[MY_REGION_CODE]", "city": "[MY_CITY]", "locality": "[MY_LOCALITY]", "postcode": "", "plusCode": "[MY_PLUS_CODE]", "administrative": [ { "name": "[MY_COUNTRY_NAME]", "description": "pa\u00eds del suroeste de Europa", "isoName": "[MY_COUNTRY_ISO_NAME]", "order": 2, "adminLevel": 2, "isoCode": "[MY_COUNTRY_ISO_CODE]", "wikidataId": "[MY_WIKIDATA_ID]", "geonameId": [MY_GEONAME_ID] }, {...}, {...} ], "informative": [ { "name": "Europa", "description": "continente ba\u00f1ado principalmente por el Atl\u00e1ntico", "isoName": "Europe", "order": 1, "isoCode": "EU", "wikidataId": "Q46", "geonameId": 6255148 }, {...} ] }, "timeZone": { "ianaTimeId": "[MY_TIMEZONE]", "displayName": "[MY_TIMEZONE_NAME]", "effectiveTimeZoneFull": "Central European Standard Time", "effectiveTimeZoneShort": "CET", "utcOffsetSeconds": 3600, "utcOffset": "+01", "isDaylightSavingTime": false, "localTime": "2025-02-01T10:30:04.4715676" } } 
Enter fullscreen mode Exit fullscreen mode

Phone and Email Verification

Availables here: https://www.bigdatacloud.com/phone-email-verification

Network Engineering

Availables here: https://www.bigdatacloud.com/network-engineering

ipapi.com

Service BIO:

APIKey EndPoints

Info about My IP

Requires only the APIKey.

Sample Request
# PowerShell Clear-Host; $MyIpapiAPIKey = "[MY_IPAPI_API_KEY]"; $RootURL = "http://api.ipapi.com"; $BaseURL = "${RootURL}/api"; $MyIpapiInfo = IRM "${BaseURL}/check?access_key=${MyIpapiAPIKey}" $MyIpapiInfo; $MyIpapiInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]", "type": "ipv4", "continent_code": "EU", "continent_name": "Europe", "country_code": "[MY_COUNTRY_CODE]", "country_name": "[MY_COUNTRY_ISO_NAME]", "region_code": "[MY_REGION_CODE]", "region_name": "[MY_REGION]", "city": "[MY_CITY]", "zip": "[MY_POBOX]", "latitude": [MY_LATITUDE], "longitude": [MY_LONGITUDE], "msa": null, "dma": null, "radius": null, "ip_routing_type": "fixed", "connection_type": "dsl", "location": { "geoname_id": [MY_GEONAME_ID], "capital": "[MY_CITY]", "languages": [ { "code": "[MY_COUNTRY_CODE]", "name": "[MY_COUNTRY_NAME]", "native": "[ONE_LANGUAGE]" }, { "code": "[MY_COUNTRY_CODE]", "name": "[MY_COUNTRY_NAME]", "native": "[OTHER_LANGUAGE]" }, {...more languages...} ], "country_flag": "[MY_COUNTRY_FLAG]", "country_flag_emoji": "[MY_COUNTRY_FLAG_EMOJI]", "country_flag_emoji_unicode": "[MY_COUNTRY_FLAG_EMOJI_UNICODE]", "calling_code": "[MY_COUNTRY_CALLING_CODE]", "is_eu": true } } 
Enter fullscreen mode Exit fullscreen mode

Info about ANY IP

Requires an APIKey and an IP.
We can retrieve our IP from here
Just, in the previous endpoin, instead of: /check put any IP, for example our own IP: ${MyIpifyIP}.

Sample Request
# PowerShell Clear-Host; $MyIpapiAPIKey = "[MY_IPAPI_API_KEY]"; $RootURL = "http://api.ipapi.com"; $BaseURL = "${RootURL}/api"; ## My IP $MyIpifyIP = ( IRM "https://api64.ipify.org?format=json" ).ip; $MyIpifyIP; $MyIpapiInfo = IRM "${BaseURL}/${MyIpifyIP}?access_key=${MyIpapiAPIKey}" $MyIpapiInfo; $MyIpapiInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]", "type": "ipv4", "continent_code": "EU", "continent_name": "Europe", "country_code": "[MY_COUNTRY_CODE]", "country_name": "[MY_COUNTRY_ISO_NAME]", "region_code": "[MY_REGION_CODE]", "region_name": "[MY_REGION]", "city": "[MY_CITY]", "zip": "[MY_POBOX]", "latitude": [MY_LATITUDE], "longitude": [MY_LONGITUDE], "msa": null, "dma": null, "radius": null, "ip_routing_type": "fixed", "connection_type": "dsl", "location": { "geoname_id": [MY_GEONAME_ID], "capital": "[MY_CITY]", "languages": [ {...several languages...} ], "country_flag": "[MY_COUNTRY_FLAG]", "country_flag_emoji": "[MY_COUNTRY_FLAG_EMOJI]", "country_flag_emoji_unicode": "[MY_COUNTRY_FLAG_EMOJI_UNICODE]", "calling_code": "[MY_COUNTRY_CALLING_CODE]", "is_eu": true } } 
Enter fullscreen mode Exit fullscreen mode

AbstractAPI.com

Service BIO:

APIKey EndPoints

IP Geolocation

Requires an APIKey and an optional IP.
We can retrieve our IP from here

Sample Request
# PowerShell Clear-Host; $MyAAPIKey = "[MY_AAPI_API_KEY]"; $RootURL = "https://ipgeolocation.abstractapi.com"; $BaseURL = "${RootURL}/v1"; ## Without IP ## ---------------- $MyAApiInfo = IRM "${BaseURL}/?api_key=${MyAAPIKey}" $MyAApiInfo; $MyAApiInfo | ConvertTo-Json -Depth 9; ## With any IP ## ---------------- ## My IP $MyIpifyIP = ( IRM "https://api64.ipify.org?format=json" ).ip; $MyIpifyIP; $MyAApiInfo = IRM "${BaseURL}/?api_key=${MyAAPIKey}&ip_address=${MyIpifyIP}" $MyAApiInfo; $MyAApiInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip_address": "[MY_IP]", "city": "[MY_CITY]", "city_geoname_id": [MY_CITY_GEONAME_ID], "region": "[MY_REGION]", "region_iso_code": "[MY_REGION_ISO_CODE]", "region_geoname_id": [MY_REGION_GEONAME_ID], "postal_code": "[MY_POBOX]", "country": "[MY_COUNTRY_ISO_NAME]", "country_code": "[MY_COUNTRY_CODE]", "country_geoname_id": [MY_COUNTRY_CODE_GEONAME_ID], "country_is_eu": true, "continent": "Europe", "continent_code": "EU", "continent_geoname_id": 6255148, "longitude": [MY_LONGITUDE_SHORT], "latitude": [MY_LATITUDE_SHORT], "security": { "is_vpn": false }, "timezone": { "name": "[MY_TIMEZONE]", "abbreviation": "CET", "gmt_offset": 1, "current_time": "11:04:34", "is_dst": false }, "flag": { "emoji": "[MY_COUNTRY_FLAG_EMOJI]", "unicode": "[MY_COUNTRY_FLAG_EMOJI_UNICODE]", "png": "[MY_COUNTRY_FLAG_PNG]", "svg": "[MY_COUNTRY_FLAG_SVG]" }, "currency": { "currency_name": "Euros", "currency_code": "EUR" }, "connection": { "autonomous_system_number": [MY_ASN], "autonomous_system_organization": "[MY_ASN_NAME]", "connection_type": null, "isp_name": null, "organization_name": null } } 
Enter fullscreen mode Exit fullscreen mode

ipify.com

Service BIO:

FREE EndPoints

My IP

Sample Request
# PowerShell Clear-Host; $BaseURL = "https://api64.ipify.org?format=json"; $Response = IRM "${BaseURL}"; $Response; $Response | ConvertTo-Json -Depth 9; ## My IP $MyIpifyIP = $Response.ip; $MyIpifyIP; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]" } 
Enter fullscreen mode Exit fullscreen mode

ipify.com only offers the "My IP" for free.
With the "subscription plan", more/extra information is available.

APIKey EndPoints

My Info

Sample Request
# PowerShell Clear-Host; $MyIpifyAPIKey = "[MY_IPIFY_API_KEY]"; $RootURL = "https://geo.ipify.org"; $BaseURL = "${RootURL}/api/v2"; $MyIpifyInfo = IRM "${BaseURL}/country?apiKey=${MyIpifyAPIKey}&ipAddress=${MyIpifyIP}" $MyIpifyInfo; $MyIpifyInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]", "location": { "country": "[MY_COUNTRY_CODE]", "region": "[MY_REGION]", "timezone": "+00:00" }, "as": { "asn": [MY_ASN], "name": "[MY_ASN_NAME]", "route": "[MY_ASN_NETWORK]", "domain": "[MY_ASN_WEBSITE]", "type": "" }, "isp": "[MY_ASN_NAME]" } 
Enter fullscreen mode Exit fullscreen mode

My Extended Info

Sample Request
# PowerShell Clear-Host; $MyIpifyAPIKey = "[MY_IPIFY_API_KEY]"; $RootURL = "https://geo.ipify.org"; $BaseURL = "${RootURL}/api/v2"; $MyIpifyExtendedInfo = IRM "${BaseURL}/country,city?apiKey=${MyIpifyAPIKey}&ipAddress=${MyIpifyIP}" $MyIpifyExtendedInfo; $MyIpifyExtendedInfo | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "ip": "[MY_IP]", "location": { "country": "[MY_COUNTRY]", "region": "[MY_REGION]", "city": "[MY_CITY]", "lat": [MY_LATITUDE_SHORT], "lng": [MY_LONGITUDE_SHORT], "postalCode": "[MY_POBOX]", "timezone": "+00:00", "geonameId": [MY_GEONAME_ID] }, "as": { "asn": [MY_ASN], "name": "[MY_ASN_NAME]", "route": "[MY_ASN_NETWORK]", "domain": "[MY_ASN_WEBSITE]", "type": "" }, "isp": "[MY_ASN_NAME]" } 
Enter fullscreen mode Exit fullscreen mode

My Balance

Sample Request
# PowerShell Clear-Host; $MyIpifyAPIKey = "[MY_IPIFY_API_KEY]"; $RootURL = "https://geo.ipify.org"; $BaseURL = "${RootURL}/api/v2"; $MyIpifyBalance = IRM "${RootURL}/service/account-balance?apiKey=${MyIpifyAPIKey}" $MyIpifyBalance; $MyIpifyBalance | ConvertTo-Json -Depth 9; 
Enter fullscreen mode Exit fullscreen mode
Sample Response
{ "credits": [MY_REMAINING_CREDITS] } 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)