Geolocator API Ver 2.1
 Generate Key
Documentation
FAQs
 Service Status
API Documentation
Geolocator is a 100% free SaaS product developed by PTS Technologies to help developers find the geolocation of any given IP address with ease, the API is very easy to use and compatible with your web and mobile apps.
https://developers.powerstonegh.com/api?ip={IP_ADDRESS}&key={API_KEY}
API ENDPOINT
Request Parameters
More Tutorials in other languages such as Java, C# etc will soon be added
EXAMPLES & TUTORIALS
API REQUEST CALL
https://developers.powerstonegh.com/api?ip=3.145.107.181&key={YOUR_API_KEY}
API RESPONSE (JSON)
Tutorial No. 1 PHP file_get_contents(); By Newhope Bedzra

<?php
//Powerstone Geolocator API
$PowerstoneURL='https://developers.powerstonegh.com/api?ip={IP_ADDRESS}&key={YOUR_API_KEY}';
$details = file_get_contents($PowerstoneURL);
//Decode JSON response
$data = json_decode($details);
$ex_rate = $data->{'exchange_rate'}; //You can now use exchange rate $ex_rate anywhere in your project
$country_code = $data->{'country_code'}; //You can now use $country_code anywhere in your project
$country = $data->{'country_name'}; //You can now use $country anywhere in your project
$flag = $data->{'country_flag'}; //You can now use $flag anywhere in your project like so echo '<img src="'.$flag.'" alt="'.$country.'">';
$region = $data->{'country_subdivision'}; //You can now use $region anywhere in your project
$city = $data->{'city'}; //You can now use $city anywhere in your project
$currency = $data->{'currency'}; //You can now use $currency anywhere in your project
$continent = $data->{'continent_name'}; //You can now use $continent anywhere in your project
$longitude = $data->{'longitude'}; //You can now use $longitude anywhere in your project
$latitude = $data->{'latitude'}; //You can now use $latitude anywhere in your project
$local_time = $data->{'country_date_time'}; //You can now use $local_time anywhere in your project
$timezone = $data->{'time_zone'}; //You can now use $timezone anywhere in your project
?>
Tutorial No. 2 PHP (cURL) By Newhope Bedzra

<?php
//Powerstone Geolocator API
$key = '{YOUR_API_KEY}';
$ip_address = '{IP_ADDRESS}';
// Initialize
$ch = curl_init('https://developers.powerstonegh.com/api?ip='.$ip_address.'&key='.$key.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
//Decode JSON response
$data = json_decode($json);
$ex_rate = $data->{'exchange_rate'}; //You can now use exchange rate $ex_rate anywhere in your project
$country_code = $data->{'country_code'}; //You can now use $country_code anywhere in your project
$country = $data->{'country_name'}; //You can now use $country anywhere in your project
$flag = $data->{'country_flag'}; //You can now use $flag anywhere in your project like so echo '<img src="'.$flag.'" alt="'.$country.'">';
$region = $data->{'country_subdivision'}; //You can now use $region anywhere in your project
$city = $data->{'city'}; //You can now use $city anywhere in your project
$currency = $data->{'currency'}; //You can now use $currency anywhere in your project
$continent = $data->{'continent_name'}; //You can now use $continent anywhere in your project
$longitude = $data->{'longitude'}; //You can now use $longitude anywhere in your project
$latitude = $data->{'latitude'}; //You can now use $latitude anywhere in your project
$local_time = $data->{'country_date_time'}; //You can now use $local_time anywhere in your project
$timezone = $data->{'time_zone'}; //You can now use $timezone anywhere in your project
?>
Tutorial No. 3 JavaScript (jQuery) By Newhope Bedzra

<!-- add jQuery library to your page -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script>
// set your API key (remember this can be seen within your browser when someone inspects the element)
api_key = '{YOUR_APIKEY}';
//Now make your ajax call
$.ajax({
    url: 'https://developers.powerstonegh.com/api?key=' + api_key,   
    dataType: 'json',
    success: function(json) {
        //exchange rate is stored in json.exchange_rate
        alert(json.exchange_rate);
        //You can continue to access data like alert(json.country_name); ...etc
    }
});
</script>
<!-- there is no need for setting the user ip address coz the API will get it -->
The geolocation data marked with asterisk * at the end are generated from GeoLite data created by MaxMind, available at maxmind.com
whiles the live exchange rate data is obtained from Currencylayer, a product created by Apilayer.com
NameDescription
statusThe status of your API call, should return "success" or "error"
responseThis will tell you the reason for your "error" status if it returns unsuccessful
versionThis is the current version of our API
call_timeThe time of call to our server in Ghana time or UTC
country_name *This is the country location of the IP address provided
continent_name *The continent on which the country of the IP is located
country_flagA direct URL to the flag of that country, making it easier for you to use in your app
country_code *The ISO code of the country detected from the IP provided
time_zone *This is the time zone of the country from the IP address
country_date_timeThe current local time of that country based on the time zone
country_subdivision *This is usually the region within the country where the IP address is located
city *This is the city within the country where the IP address is located
longitude *This is the longitude of the precise location of the IP address
latitude *This is the latitude of the precise location of the IP address
currencyThis is the currency of the country where the IP is located
exchange_rateThis is the current and live exchange rate of the country's currency at the time of call
Response Properties
NameRequiredDescription
keyyesEven though Geolocator is free, we still request users to use API keys and it's free, get yours here
formatnoAs at now we only provide our data in json format, other formats will be introduced in future
ipyesYou need to provide the IP address to geolocate, if no IP is provided, the API will use the IP of the source computer
delimeternoNo delimeters are needed