Documentation
Authentication
After signing up and validating your email, you will be able to find your API Key in your dashboard.
To make a request, you will need to append an api_key query parameter to every request.
GET: https://api.getgeoapi.com/v2/ip/check?api_key={YOUR_API_KEY}
Formats
We currently support JSON and XML formats. To specify the format you need to attach the format parameter to the request as shown in the example below
GET: https://api.getgeoapi.com/v2/ip/check
?api_key={YOUR_API_KEY}
&format={FORMAT}
The format parameter can have the following options:
- json
- xml
Endpoints
Please remember to add your api_key to every request.
The endpoint below returns the geo data of your IP address. You can find more information about it in the Requester IP Lookup section.
GET: https://api.getgeoapi.com/v2/ip/check
GET: https://api.getgeoapi.com/v2/ip/{ip}
IPv4 / IPv6 Lookup
IP Lookup returns geo location data of any provided IPv4 or IPv6 address.
Endpoint:
GET: https://api.getgeoapi.com/v2/ip/{IP}
Example request:
GET: https://api.getgeoapi.com/v2/ip/37.140.128.10 ?api_key={YOUR_API_KEY} &format=json&filter=city&language=en
Request parameters:
Parameter | Description |
---|---|
ip (required) | Any IPv4 or IPv6 address |
api_key (required) | API Key that every registered user has and can be found in the Dashboard |
format (optional) | The output format. It can be json or xml |
filter (optional) | Filter the response and get only the required data. Options: asn, city, country, continent, area, currency, security, time, postcode. Can be comma separated. |
language (optional) | Return data in one of the following languages: en,ru,zh,es,ar,fr,fa,ja,pl,it,pt,de |
Go to the section IP Lookup Response to see the example of the response.
Requester IP Lookup
Requester IP Lookup returns geo data of the IP address which is calling the API.
Endpoint:
GET: https://api.getgeoapi.com/v2/ip/check
Example request:
GET: https://api.getgeoapi.com/v2/ip/check ?api_key={YOUR_API_KEY} &format=json
Request parameters:
Parameter | Description |
---|---|
api_key (required) | API Key that every registered user has and can be found in the Dashboard |
format (optional) | The output format. It can be json or xml |
filter (optional) | Filter the response and get only the required data. Options: asn, city, country, continent, area, currency, security, time, postcode. Can be comma separated. |
language (optional) | Return data in one of the following languages: en,ru,zh,es,ar,fr,fa,ja,pl,it,pt,de |
IP Lookup Response
The example of the response for the IP 37.140.128.10
Response object:
Property | Description |
---|---|
status | The status of the request. Can be 'success' or 'fail' |
ip | The requested IP address |
type | The type of the requested IP address. Can be IPv4 or IPv6 |
city -> name | The name of the city of the requested IP address or empty value. |
city -> geonameid | The id of the record in the geonames database. |
city -> population | The population of the city of the requested IP address or empty value. |
area -> code | The region or area code of the requested IP address or empty value. |
area -> geonameid | The id of the record in the geonames database. |
area -> name | The region or area name of the requested IP address or empty value. |
country -> code | The country code of the requested IP address or empty value. |
country -> geonameid | The id of the record in the geonames database. |
country -> name | The country name of the requested IP address or empty value. |
country -> phone_code | The country phone number prefix of the requested IP address or empty value. |
country -> area_size | The country size in sq. km. of the requested IP address or empty value. |
country -> capital | The country capital of the requested IP address or empty value. |
country -> population | The country population of the requested IP address or empty value. |
country -> is_in_eu | True if the country of the requested IP is in Euro Union . |
country -> flag -> emoji | The emoji of the country flag . |
country -> flag -> file | The url of the file of the country flag in wikipedia. |
country -> flag -> unicode | The unicode of the country flag. |
country -> languages | A list of languages spoken in the country. |
time -> timezone | The timezone of the requested IP address or empty value. |
time -> is_daylight_saving | Is it a daylight saving time. |
time -> gmt_offset | The GMT offset in seconds |
time -> code | Abbreviation of the timezone |
asn -> organisation | The company name of the requested IP address or empty value. |
asn -> number | The Autonomous System Number of the requested IP address or empty value. |
currency -> code | The local currency code of the requested IP address or empty value. |
currency -> name | The local currency name of the requested IP address or empty value. |
location -> latitude | The latitude of the requested IP address or empty value. |
location -> longitude | The longitude of the requested IP address or empty value. |
security -> is_tor | True if the requested IP address is tor. |
security -> is_proxy | True if the requested IP address is proxy. |
security -> is_threat | True if the requested IP address is known to be a threat. |
security -> is_crawler | True if the requested IP address is crawler. |
continent -> code | The continent code of the requested IP address or empty value. |
continent -> geonameid | The id of the record in the geonames database. |
continent -> name | The continent code of the requested IP address or empty value. |
postcode | The postal code of the requested IP address or empty value. |
Errors
In case the request fails or the resource is not available an error will be returned in JSON or XML format.
Error response example:
Error codes:
Code | Description |
---|---|
400 | Bad request. |
403 |
|
404 | Resource is not found or requested format is incorrect |
405 | Method is not allowed. |
500 | Server error. We hope you will never see this error. |
Code Examples
PHP example:
<?php $key = "{YOUR_API_KEY}"; $url = "https://api.getgeoapi.com/v2/ip/check?api_key=".$key."&format=json"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response, true); print_r($json); ?>
Python example:
import requests key = "{YOUR_API_KEY}" parameters = {"api_key": key, "format": "json"} url = "https://api.getgeoapi.com/v2/ip/check response = requests.get(url, parameters) print(response.json())
JavaScript ES6 example:
const key = "{YOUR_API_KEY}"; const url = `https://api.getgeoapi.com/v2/ip/check?api_key=${key}&format=json` fetch(url) .then(response => response.json()) .then(data => console.log(data));
JavaScript/jQuery example:
var key = "{YOUR_API_KEY}"; var url = "https://api.getgeoapi.com/v2/ip/check?api_key=" + key + "&format=json" $.getJSON(url, function (data) { console.log(data); });
Curl example:
curl --request GET \ --url 'https://api.getgeoapi.com/v2/ip/check?api_key={YOUR_API_KEY}'
IP GEO API
Get location by IP address
CURRENCY API
Get currency exhange rates