IP Geolocation

Identify visitor location, enhance security, personalize content, and prevent fraud with our reliable IP Geolocation API.

Last updated: March 7, 2026

Enter an IP address (e.g., 8.8.8.8) or leave blank to use your current IP
Usage
0 / day
Remaining
500 / day
Average
0 MS
IP Address
216.73.216.61

Integrate in Minutes

Two steps: get your token, then make the GET request. Pick your language and start building.

# Step 1: Get your auth token
TOKEN=$(curl -s "https://api.sthan.io/Auth/Token" \
  -H "profileName: YOUR_PROFILE_NAME" \
  -H "profilePassword: YOUR_PROFILE_PASSWORD" | jq -r '.access_token')

# Step 2: Make the API call
curl "https://api.sthan.io/IpGeolocation/8.8.8.8" \
  -H "Authorization: Bearer $TOKEN"
// Step 1: Get your auth token
const auth = await fetch("https://api.sthan.io/Auth/Token", {
  headers: {
    "profileName": "YOUR_PROFILE_NAME",
    "profilePassword": "YOUR_PROFILE_PASSWORD"
  }
});
const { access_token } = await auth.json();

// Step 2: Make the API call
const response = await fetch("https://api.sthan.io/IpGeolocation/8.8.8.8", {
  headers: { "Authorization": `Bearer ${access_token}` }
});
const data = await response.json();
console.log(data);
import requests

# Step 1: Get your auth token
auth = requests.get(
    "https://api.sthan.io/Auth/Token",
    headers={
        "profileName": "YOUR_PROFILE_NAME",
        "profilePassword": "YOUR_PROFILE_PASSWORD"
    }
)
token = auth.json()["access_token"]

# Step 2: Make the API call
response = requests.get(
    "https://api.sthan.io/IpGeolocation/8.8.8.8",
    headers={"Authorization": f"Bearer {token}"}
)
data = response.json()
print(data)
using var client = new HttpClient();

// Step 1: Get your auth token
client.DefaultRequestHeaders.Add("profileName", "YOUR_PROFILE_NAME");
client.DefaultRequestHeaders.Add("profilePassword", "YOUR_PROFILE_PASSWORD");
var authJson = await client.GetStringAsync("https://api.sthan.io/Auth/Token");
var auth = JsonSerializer.Deserialize<JsonElement>(authJson);
var token = auth.GetProperty("access_token").GetString();

// Step 2: Make the API call
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var response = await client.GetStringAsync(
    "https://api.sthan.io/IpGeolocation/8.8.8.8");
Console.WriteLine(response);
import java.net.*; import java.net.http.*;

// Step 1: Get your auth token
HttpClient client = HttpClient.newHttpClient();
HttpRequest authReq = HttpRequest.newBuilder()
    .uri(URI.create("https://api.sthan.io/Auth/Token"))
    .header("profileName", "YOUR_PROFILE_NAME")
    .header("profilePassword", "YOUR_PROFILE_PASSWORD")
    .build();
HttpResponse<String> authResp = client.send(authReq,
    HttpResponse.BodyHandlers.ofString());
// Parse access_token from authResp.body()

// Step 2: Make the API call
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.sthan.io/IpGeolocation/8.8.8.8"))
    .header("Authorization", "Bearer " + token)
    .build();
HttpResponse<String> resp = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
// Step 1: Get your auth token
$ch = curl_init("https://api.sthan.io/Auth/Token");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "profileName: YOUR_PROFILE_NAME",
    "profilePassword: YOUR_PROFILE_PASSWORD"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
$token = $data["access_token"];

// Step 2: Make the API call
$ch = curl_init("https://api.sthan.io/IpGeolocation/8.8.8.8");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer " . $token
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
require 'net/http'
require 'json'

# Step 1: Get your auth token
uri = URI("https://api.sthan.io/Auth/Token")
req = Net::HTTP::Get.new(uri)
req["profileName"] = "YOUR_PROFILE_NAME"
req["profilePassword"] = "YOUR_PROFILE_PASSWORD"
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
  http.request(req)
}
token = JSON.parse(resp.body)["access_token"]

# Step 2: Make the API call
uri = URI("https://api.sthan.io/IpGeolocation/8.8.8.8")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{token}"
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
  http.request(req)
}
puts JSON.parse(resp.body)
import ("net/http"; "io"; "fmt")

// Step 1: Get your auth token
authReq, _ := http.NewRequest("GET", "https://api.sthan.io/Auth/Token", nil)
authReq.Header.Set("profileName", "YOUR_PROFILE_NAME")
authReq.Header.Set("profilePassword", "YOUR_PROFILE_PASSWORD")
authResp, _ := http.DefaultClient.Do(authReq)
defer authResp.Body.Close()
// Parse access_token from response JSON

// Step 2: Make the API call
req, _ := http.NewRequest("GET",
    "https://api.sthan.io/IpGeolocation/8.8.8.8", nil)
req.Header.Set("Authorization", "Bearer " + token)

resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
Example Response
{
  "ipAddress": "8.8.8.8",
  "country": "United States",
  "countryCode": "US",
  "region": "California",
  "city": "Mountain View",
  "latitude": 37.386,
  "longitude": -122.0838,
  "continent": "North America",
  "timezone": "America/Los_Angeles",
  "postalCode": "94043"
}

Accurate IP Geolocation for Smarter Business Decisions

Identify visitor location, enhance security, personalize content, and prevent fraud with our reliable IP Geolocation API.

Start for Free – No Credit Card Required

Try our IP Geolocation API with 50,000 free lookups per month—perfect for testing, development, and production applications.

Precise Location Intelligence

Get detailed geographic information from any IP address:

Country, State, City & Postal Code for accurate targeting.
Latitude & Longitude for mapping and proximity services.
Timezone information for scheduling and time-based operations.
ISP & Organization details for network analysis.

Enhanced Security & Fraud Prevention

Protect your business with IP-based risk assessment:

Detect suspicious login attempts from unusual locations.
Block high-risk countries or regions automatically.
Identify proxy, VPN, and datacenter IPs to prevent fraud.

Personalized User Experience

Tailor content and services based on visitor location:

Display region-specific content, pricing, and promotions.
Auto-select language and currency based on location.
Redirect users to regional servers for faster performance.

Lightning-Fast & Highly Available

Our infrastructure ensures speed and reliability:

Sub-50ms response times for instant lookups.
High availability with redundant infrastructure.
Support for both IPv4 and IPv6 addresses.

Affordable & Flexible Pricing

Premium IP geolocation at competitive rates:

Plans starting at $4.50/month for 100,000 lookups.
Save up to 40% with annual subscriptions.
No hidden fees—pay only for what you use.

Easy Integration

Get started in minutes with our RESTful API:

Simple REST API with JSON responses.
Code examples in Python, JavaScript, C#, PHP, and more.
Comprehensive documentation and support.

Secure & Privacy-Focused

We prioritize your security and privacy:

HTTPS encryption for all API requests.
We don't store your payment details.
Cancel anytime—no commitments or hidden charges.

Frequently Asked Questions

IP Geolocation is the process of determining the geographic location of an IP address. It provides information such as country, city, region, postal code, latitude, longitude, and timezone associated with an IP address.
IP Geolocation accuracy varies by location and data source. Country-level identification is generally very reliable, while city-level accuracy can vary depending on the region and IP type. Mobile and VPN traffic tends to be less precise than fixed broadband. Our database is updated regularly to maintain accuracy.
Yes, our IP Geolocation API fully supports both IPv4 and IPv6 addresses. Simply pass the IP address to our API endpoint and receive location data regardless of the IP version.
Our API returns comprehensive location data including: Country and country code, Region/State, City, Postal code, Latitude and Longitude coordinates, Timezone, Continent, and ISP/Organization information.
Our IP Geolocation API delivers sub-50ms response times, providing near-instant lookups for your applications. We use optimized infrastructure to ensure fast, reliable performance.
Yes! Sthan.io includes a generous free tier for IP Geolocation with no credit card required. Perfect for testing, development, and smaller production applications. Paid plans are available for higher volumes. See our pricing page for current plans and rates.

Ready to Get Started?

Start with 50,000 free IP lookups every month. No credit card required.