Get precise geolocation data for any IP address. Perfect for security, analytics, and personalization.
216.73.216.0
Get started with just one API call
curl https://iplocalize.com/api/v1/lookup/8.8.8.8
<?php
// Using cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://iplocalize.com/api/v1/lookup/8.8.8.8');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
// Using file_get_contents
$context = stream_context_create([
'http' => [
'header' => 'Accept: application/json'
]
]);
$response = file_get_contents('https://iplocalize.com/api/v1/lookup/8.8.8.8', false, $context);
$data = json_decode($response, true);
print_r($data);
?>
// Using Fetch API
fetch('https://iplocalize.com/api/v1/lookup/8.8.8.8', {
headers: { 'Accept': 'application/json' }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
# Using requests library
import requests
url = 'https://iplocalize.com/api/v1/lookup/8.8.8.8'
headers = {'Accept': 'application/json'}
response = requests.get(url, headers=headers)
data = response.json()
print(data)
// Using axios
const axios = require('axios');
axios.get('https://iplocalize.com/api/v1/lookup/8.8.8.8', {
headers: { 'Accept': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
// Using Java 11+ HttpClient
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class IPExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://iplocalize.com/api/v1/lookup/8.8.8.8"))
.header("Accept", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
// Using net/http
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
resp, err := http.Get("https://iplocalize.com/api/v1/lookup/8.8.8.8")
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
# Using Net::HTTP
require 'net/http'
require 'uri'
require 'json'
uri = URI("https://iplocalize.com/api/v1/lookup/8.8.8.8")
req = Net::HTTP::Get.new(uri)
req['Accept'] = 'application/json'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
end
data = JSON.parse(res.body)
puts data
// Using HttpClient
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetStringAsync("https://iplocalize.com/api/v1/lookup/8.8.8.8");
Console.WriteLine(response);
}
}
{
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"city": "Mountain View",
"region": "California",
"latitude": 37.4056,
"longitude": -122.0775,
"timezone": "America/Los_Angeles",
"isp": "Google LLC"
}
About IP Geolocation API
What is IPLocalize.com ?
IPLocalize.com offers a fast, reliable IP geolocation API for developers worldwide. Get detailed data like location, timezone, and city with a single call. Perfect for apps needing real-time geolocation to improve user experience.
With Our Free API, you can easily integrate IP geolocation into your applications. Our API is designed for speed and accuracy, providing essential data to enhance user engagement and personalization. Whether you're building a web app, mobile app, or any other service, IPLocalize.com is your go-to solution for IP-based location services.
Empower Your Solutions with IPLocalize
Deliver personalized content based on precise location data. Show region-specific promotions, adapt pricing to local currencies, and align your services with customer needs wherever they are.
Gain deeper insights into your audience with geographic analytics. Identify top-performing regions, monitor visitor trends, and use data-driven insights to grow your reach more effectively.
Increase user engagement by serving location-relevant content. From language preferences to tailored recommendations, every interaction becomes more meaningful and impactful.
Simplify registration and checkout forms with smart autocompletion. Pre-fill city, region, or country fields instantly, reducing errors and improving conversion rates for your users.
Protect your platform by detecting high-risk logins, suspicious sign-ups, and unusual transactions. With IP geolocation, you can block threats in real time and keep your users safe.
Answers to the most frequently asked questions.
Yes