An IP geolocation API lets your application look up where an IP address is — its country, region, and city — plus the ISP and network behind it, all in a single request. It's the building block for content localization, fraud scoring, analytics, and geo-aware features. Below is how it works, a real request/response example, an honest note on accuracy, and how to get an API key.
What an IP geolocation API returns
You send an IP address; the API responds with structured JSON. The core fields are consistent across most providers:
| Field | Example | Notes |
|---|---|---|
| country / country_code | United States / US | Highest confidence field. |
| region | California | State or province. |
| city | Mountain View | Best estimate — often metro-level. |
| latitude / longitude | 37.40, -122.07 | Approximate centroid, not exact. |
| timezone | America/Los_Angeles | Useful for localization. |
| asn | AS15169 | Autonomous System of the network. |
| isp / organization | Google LLC | Who owns the address block. |
A simple request and response
Calling the API is a single authenticated HTTPS GET. Pass an IP and your API key; get JSON back:
# Request
curl "https://api.ipimpala.com/v1/lookup/8.8.8.8" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response (JSON)
{
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"region": "California",
"city": "Mountain View",
"latitude": 37.4056,
"longitude": -122.0775,
"timezone": "America/Los_Angeles",
"asn": "AS15169",
"isp": "Google LLC",
"proxy": false,
"vpn": false
}
The honest truth about accuracy
Every reputable IP geolocation service should be upfront about this, so here it is plainly:
Why the gap? IP-to-location mapping is inferred from registry data, network routing, and provider-supplied hints — not from the device itself. Several things routinely skew results:
- Mobile networks route traffic through regional gateways, so a phone can appear dozens of miles from the user.
- Carrier-grade NAT shares one public IP across many subscribers.
- Corporate VPNs and cloud egress make a user look like they're at a datacenter.
- Consumer VPNs and proxies deliberately mask the true origin (which is why proxy/VPN detection matters).
The practical rule: use IP geolocation as a signal, and never as the sole basis for a decision with legal or financial consequences.
What developers build with it
Fraud & risk scoring
Compare the IP's country to the billing address, flag logins from unexpected regions, and — with VPN/proxy detection — score traffic that's hiding its origin. It's one input into a risk model, not a verdict on its own.
Content localization
Set a sensible default language, currency, or regional storefront on first visit, then let the user override. Great for reducing friction; not a substitute for explicit user preferences.
Analytics & segmentation
Enrich raw traffic logs with country, region, and ISP so you can see where demand actually comes from — without asking users for anything.
Compliance & access rules
Apply coarse, country-level routing (e.g., regional redirects). Because it's an estimate, pair it with stronger signals for anything legally binding.
Plans & limits
Start free, upgrade when you need a key or higher volume. These are the current IP Impala tiers:
Free
- 50 lookups per day
- Geolocation & ISP data
- Interactive map
- Web lookups (no API key)
Pro
- 2,000 lookups per day
- API access + key
- VPN/proxy detection
- Priority email support
Business
- Unlimited lookups
- Bulk 100+ IP batches
- CSV / JSON export
- Priority support
Ready to build with the API?
The Pro plan ($9/mo) gives you an API key, 2,000 lookups a day, and VPN/proxy detection. Processing large lists? Business ($19/mo) adds unlimited lookups, bulk 100+ IP batches, and CSV/JSON export. Every paid plan is backed by a 14-day money-back guarantee.
See Plans & Get a Key →Frequently asked questions
What does an IP geolocation API do?
An IP geolocation API takes an IP address and returns an estimated physical location and network details in a structured format, usually JSON. Typical fields include country, region/state, city, approximate latitude and longitude, time zone, and the ISP or organization that owns the address. Developers call it from a server or app to localize content, estimate a visitor's region, or assess risk.
How accurate is IP geolocation?
Country-level accuracy is very high — typically around 95 to 99 percent. City-level accuracy is far lower and varies by region, often landing in the correct metro area rather than the exact town. IP geolocation never returns a street address or a specific household. Mobile networks, corporate VPNs, and carrier-grade NAT can shift the apparent location by many miles, so treat results as an estimate, not a precise fix.
Is there a free IP geolocation API?
Yes. IP Impala's free plan includes 50 lookups per day with geolocation and ISP data. For programmatic API access with a key, higher limits, and VPN/proxy detection, the Pro plan is $9/month with 2,000 lookups per day, and the Business plan is $19/month with unlimited lookups, bulk batches, and CSV/JSON export.
What format does the API return?
The API returns JSON. A typical response includes the queried IP, country and country code, region, city, approximate latitude and longitude, time zone, ASN, and the ISP or organization. Business plans can also export batched results as CSV or JSON for offline processing.
Can an IP geolocation API detect VPNs and proxies?
Yes. IP Impala's Pro and Business plans include VPN and proxy detection, which flags when an IP belongs to a known hosting provider, anonymizer, or datacenter range rather than a residential ISP. This is useful for fraud scoring and for spotting traffic that is trying to hide its true origin.
Should I use IP geolocation for legal compliance or billing?
Use it as a signal, not a source of truth. Because IP geolocation is an estimate, do not rely on it alone for anything requiring a precise, verified location — such as tax jurisdiction, age-gating, or fraud decisions with real consequences. Combine it with other signals like billing address, device data, or explicit user confirmation.