GeoPlugin provides a free geolocation API in multiple different programming languages, all in a single API call. No software installation required, no API key. Whether your programming language of choice is Javascript, PHP, XML, JSON, ASP, or CSV, geoPlugin has a way to simply and efficiently geo-localize your visitors.
const requestUri = 'https://api.geoplugin.com';
const ipAddress = '8.8.8.8';
const key = 'your_api_key';
const url = `${requestUri}?ip=${ipAddress}&auth=${key}`;
fetch(url)
.then(response => response.json())
.then(data => {
const result = data;
console.log(result);
console.log(`Country: ${result.geoplugin_countryName}`);
console.log(`Timezone: ${result.geoplugin_timezone}`);
})
.catch(error => {
console.error('Error fetching data:', error);
});
$request_uri = 'https://api.geoplugin.com';
$ip_address = '8.8.8.8';
$key = 'your_api_key';
$url= $request_uri . "?ip=" . $ip_address . "&auth=" . $key;
$document= file_get_contents($url);
$result = json_decode($document);
const requestUri = 'https://api.geoplugin.com';
const ipAddress = '8.8.8.8';
const key = 'your_api_key';
const url = `${requestUri}?ip=${ipAddress}&auth=${key}`;
fetch(url)
.then(response => response.text())
.then(xml => {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xml, "application/xml");
console.log(xmlDoc);
console.log(`Country: ${xmlDoc.getElementsByTagName("geoplugin_countryName")[0].childNodes[0].nodeValue}`);
console.log(`Timezone: ${xmlDoc.getElementsByTagName("geoplugin_timezone")[0].childNodes[0].nodeValue}`);
})
.catch(error => {
console.error('Error fetching data:', error);
});
const requestUri = 'https://api.geoplugin.com';
const ipAddress = '8.8.8.8';
const key = 'your_api_key';
const url = `${requestUri}?ip=${ipAddress}&auth=${key}`;
fetch(url)
.then(response => response.json())
.then(data => {
const result = data;
console.log(result);
console.log(`Country: ${result.geoplugin_countryName}`);
console.log(`Timezone: ${result.geoplugin_timezone}`);
})
.catch(error => {
console.error('Error fetching data:', error);
});
using System;
using System.Net.Http;
using System.Threading.Tasks;
public class Program
{
public static async Task Main(string[] args)
{
var ip = "8.8.8.8";
var authKey = "your_api_key";
var url = $"https://api.geoplugin.com?ip={ip}&auth={authKey}";
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
}
using System.Net.Http;
using System.Threading.Tasks;
public class Program
{
public static async Task Main(string[] args)
{
var ip = "8.8.8.8";
var authKey = "your_api_key";
var url = $"https://api.geoplugin.com?ip={ip}&auth={authKey}";
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept", "text/csv");
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
}
Below are our external monitors for webservice uptime and internal live graphs on the lookups we handle.
Show location based content for a personalized visitor experience.
Create a local feel for your visitors and instantly enhance trust.
Deliver location-specific offers to drive higher conversions and revenue.