API Documentation in your language of choice

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);

}

}

Live API statistics

Below are our external monitors for webservice uptime and internal live graphs on the lookups we handle.

Request per hour
GeoPlugin requests - By Day
Request per day
GeoPlugin requests - By Week

Geo targeting works.Try it today.

Geoplugin circuclar black icon with two upward arrows next to a person symbolizing user experience.

Enhance the visitor experience

Show location based content for a personalized visitor experience.

Geoplugin black circular icon with a green check mark on a badge symbolizing trustworthy service.

Build trust with your audience.

Create a local feel for your visitors and instantly enhance trust.

Geoplugin black circular icon with a green rocket ship symbolizing boosted conversions through geotargeting.

Drastically boost conversions.

Deliver location-specific offers to drive higher conversions and revenue.