IP Geolocation
9 min
ip geolocation api provides real time and accurate geolocation, and security information for any ipv4 or ipv6 address and domain name along with the user agent detail for the provided user agent string you can geolocate your online visitors and provide them the customized user experience accordingly asset setup keep in mind that the ip geolocation api exposes the api token in the url by design this is a security risk as the api token is a secret and can be used to make requests to this paid api it is a public key that is used to identify your account you can use the api token in the url or in the http header the api token is a unique identifier for your account you can find your api token in the dashboard https //dashboard ipgeolocation io/ configurations api key authentication authenticates using an api key configuration parameters parameter description type required url a url to the target host string required api key api key string optional verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional actions ip lookup get information about the ip or domain name endpoint url /ipgeo method get input argument name type required description ip string required parameter for ip lookup lang string optional parameter for ip lookup fields string optional parameter for ip lookup excludes string optional parameter for ip lookup include string optional parameter for ip lookup output parameter type description status code number http status code of the response reason string response reason phrase ip string output field ip continent code string output field continent code continent name string name of the resource country code2 string output field country code2 country code3 string output field country code3 country name string name of the resource country capital string output field country capital state prov string output field state prov district string output field district city string output field city zipcode string output field zipcode latitude string output field latitude longitude string output field longitude is eu boolean output field is eu calling code string output field calling code country tld string output field country tld languages string output field languages country flag string output field country flag geoname id string unique identifier isp string output field isp connection type string type of the resource organization string output field organization currency object output field currency example \[ { "status code" 200, "response headers" { "date" "sat, 04 mar 2023 23 37 52 gmt", "content type" "application/json;charset=utf 8", "transfer encoding" "chunked", "connection" "keep alive", "x application context" "application\ production 8002", "cf cache status" "dynamic", "strict transport security" "max age=31536000; includesubdomains; preload", "server" "cloudflare", "cf ray" "7a2df315bf01d2cc eze", "content encoding" "gzip", "alt svc" "h3=\\" 443\\"; ma=86400, h3 29=\\" 443\\"; ma=86400" }, "reason" "ok", "json body" { "ip" "8 8 8 8", "continent code" "na", "continent name" "north america", "country code2" "us", "country code3" "usa", "country name" "united states", "country capital" "washington, d c ", "state prov" "california", "district" "", "city" "mountain view", "zipcode" "94043 1351", "latitude" "37 42240", "longitude" " 122 08421", "is eu" false, "calling code" "+1" } } ] response headers header description example alt svc http response header alt svc h3=" 443 "; ma=86400, h3 29=" 443 "; ma=86400 cf cache status http response header cf cache status dynamic cf ray http response header cf ray 7a2df315bf01d2cc eze connection http response header connection keep alive content encoding http response header content encoding gzip content type the media type of the resource application/json;charset=utf 8 date the date and time at which the message was originated sat, 04 mar 2023 23 37 52 gmt server information about the software used by the origin server cloudflare strict transport security http response header strict transport security max age=31536000; includesubdomains; preload transfer encoding http response header transfer encoding chunked x application context http response header x application context application\ production 8002