Add IP Geolocation to Your Geocoding Stack in One Call
Submillisecond IP-to-location lookup with country, region, city, county, and ASN. Bundled into every CSV2GEO plan including Free — no vendor API call.
If you already use CSV2GEO for address geocoding, you can now resolve IP addresses too — country, region, city, postal code, ASN, and county — through the same API key, in one call, with sub-millisecond response times.
The endpoint is GET /api/v1/ip?ip=…. It's bundled into every plan including Free. No separate billing, no separate vendor.
How accurate is IP geolocation, really?
Honest answer: it depends on the IP type, and you should design around that, not pretend it doesn't matter.
| IP type | Country | Region/state | City | County | |---|---|---|---|---| | Residential / business / datacenter | ~99.8% | ~80% | 60–80% | High (derived from coordinates) | | Anycast (DNS, cloud edge, CDN POPs) | ✅ | ❌ | ❌ | ❌ | | VPN / proxy / Tor exit | ✅ (of exit) | ✅ (of exit) | ✅ (of exit) | ❌ | | Mobile / cellular | ✅ | ⚠️ often wrong | ⚠️ often wrong | ❌ |
The CSV2GEO /api/v1/ip response includes a confidence label (high, medium, low) plus an accuracy_disclaimer field on low-confidence answers, so your code can route low-confidence IPs through a different path instead of pretending it knows where Google's 8.8.8.8 lives.
How the county overlay works
Off-the-shelf IP databases give you country, region, and city. They don't give you county.
Here's what /api/v1/ip does, in order, every call:
- MaxMind .mmdb lookup — local, in-process, sub-millisecond. Returns country, region, city, postal code, lat/lng, accuracy radius, timezone, ASN.
- Postcode → divisions join — if MaxMind returned a postcode for a country we have boundary coverage in, we look up the division (locality) keyed off that postcode and walk one level up to fetch the county.
- Confidence labelling — high requires both a tight accuracy radius (≤50 km) AND a polygon match. Anycast IPs get low confidence and a disclaimer.
End result for a residential AT&T IP in Michigan:
{
"ip": "107.192.40.118",
"country": { "code": "US", "name": "United States" },
"region": { "code": "MI", "name": "Michigan" },
"city": { "name": "Grand Rapids" },
"county": { "name": "Kent County", "wikidata": "Q82499" },
"locality": { "name": "Walker", "wikidata": "Q537120" },
"postcode": "49504",
"location": { "latitude": 42.9733, "longitude": -85.7286, "accuracy_radius_km": 5 },
"timezone": "America/Detroit",
"isp": { "asn": 7018, "name": "AT&T Enterprises, LLC" },
"confidence": "high",
"source": "maxmind-geolite2",
"db_build_at": "2026-05-04T20:41:43Z"
}For an anycast IP like 8.8.8.8, the same call returns country only, confidence: low, and an accuracy_disclaimer telling the caller not to trust city-level data here.
Three endpoints, same shape
# Single
curl "https://csv2geo.com/api/v1/ip?ip=8.8.8.8&api_key=YOUR_KEY"
# The requester's IP — handy from server-side logging
curl "https://csv2geo.com/api/v1/ip/me?api_key=YOUR_KEY"
# Batch — up to 1000 IPs per call
curl -X POST "https://csv2geo.com/api/v1/ip/batch?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"ips":["8.8.8.8","1.1.1.1","107.192.40.118"]}'In the SDKs
Python (`csv2geo` 1.2.0+ on PyPI):
from csv2geo import Client
client = Client("geo_live_…")
r = client.ip("107.192.40.118")
print(r["county"]["name"], r["confidence"])
# Kent County highNode.js (`csv2geo-sdk` 1.2.0+ on npm):
const { Client } = require('csv2geo-sdk');
const client = new Client('geo_live_…');
const r = await client.ip('107.192.40.118');
console.log(r.county?.name, r.confidence);
// Kent County highPricing — included in every plan
Because the lookup is purely local (MaxMind GeoLite2 .mmdb plus our own polygons), there's zero marginal cost per call. We didn't want to invent an artificial pricing tier for a feature that doesn't cost us anything to serve. So /api/v1/ip is included in every plan including Free, with the same daily limits as the rest of the API.
When you should still use a paid IP service
If you genuinely need building-level IP precision for fraud-detection or ad targeting, MaxMind's commercial GeoIP2 Insights or IPinfo's paid Pro tier exist for a reason. For most adjacencies — geofencing, country compliance, currency selection, language defaulting, latency routing, basic analytics — /api/v1/ip is enough, and it ships with a confidence flag so you know when to trust it.
FAQ
How accurate is IP geolocation at city level?
For consumer ISP traffic in major metros: roughly 70–80% within the correct city, 95%+ within the correct region/state. For business addresses and corporate IPs the city-level rate drops closer to 50% because corporate networks frequently anycast traffic through far-away points of presence. The confidence field on every response tells you when you're in the second case so your downstream code can decide whether to trust the result.
Does it work behind VPNs and corporate proxies?
The result reflects the *VPN exit IP*, not the user's actual location. A VPN provider's Chicago exit shows Chicago regardless of whether the user is in São Paulo or Stockholm. This is unavoidable from any IP service. We flag known-anonymous IPs (Tor, residential VPN endpoints, hosting providers) with anycast or proxy markers so you know when to ask for a primary signal (declared address, GPS, account country).
Does CSV2GEO charge separately for IP geolocation?
No. The lookup is purely local (MaxMind GeoLite2 .mmdb plus our admin-boundary overlay) — zero marginal cost on our side, so we didn't invent an artificial pricing tier for it. /api/v1/ip is included in every plan including Free, and consumes against the same daily request quota as every other endpoint.
Can I use IP geolocation for compliance or geo-fencing?
Yes for soft compliance — default UI language, currency selection, country code pre-fill, latency-aware routing, analytics buckets. Those are fine to get wrong 10–20% of the time. No for hard compliance — GDPR data residency, US export-control screening, regulated gambling, age-gating. For hard compliance, combine IP with a declared address and explicit user consent.
Why a local .mmdb file instead of a hosted lookup service?
Two reasons: sub-millisecond latency (no network round-trip) and predictable cost (no per-call pricing). Hosted IP-lookup APIs add 50–200 ms to every call and bill per request — fine for one-off lookups, expensive at high request volume. A local .mmdb refreshed weekly is the standard pattern when IP geolocation sits in the hot path of every API request.
FAQ
How accurate is IP geolocation at city level?
For consumer ISP traffic in major metros: roughly 70–80% within the correct city, 95%+ within the correct region/state. For business addresses and corporate IPs the city-level rate drops closer to 50% because corporate networks frequently anycast traffic through far-away points of presence. The confidence field on every response tells you when you're in the second case so your downstream code can decide whether to trust the result.
Does it work behind VPNs and corporate proxies?
The result reflects the *VPN exit IP*, not the user's actual location. A VPN provider's Chicago exit shows Chicago regardless of whether the user is in São Paulo or Stockholm. This is unavoidable from any IP service. We flag known-anonymous IPs (Tor, residential VPN endpoints, hosting providers) with anycast or proxy markers so you know when to ask for a primary signal (declared address, GPS, account country).
Does CSV2GEO charge separately for IP geolocation?
No. The lookup is purely local (MaxMind GeoLite2 .mmdb plus our admin-boundary overlay) — zero marginal cost on our side, so we didn't invent an artificial pricing tier for it. /api/v1/ip is included in every plan including Free, and consumes against the same daily request quota as every other endpoint.
Can I use IP geolocation for compliance or geo-fencing?
Yes for soft compliance — default UI language, currency selection, country code pre-fill, latency-aware routing, analytics buckets. Those are fine to get wrong 10–20% of the time. No for hard compliance — GDPR data residency, US export-control screening, regulated gambling, age-gating. For hard compliance, combine IP with a declared address and explicit user consent.
Why a local .mmdb file instead of a hosted lookup service?
Two reasons: sub-millisecond latency (no network round-trip) and predictable cost (no per-call pricing). Hosted IP-lookup APIs add 50–200 ms to every call and bill per request — fine for one-off lookups, expensive at high request volume. A local .mmdb refreshed weekly is the standard pattern when IP geolocation sits in the hot path of every API request.
Quickstart
- Get a free API key at csv2geo.com/api-keys
pip install csv2geoornpm install csv2geo-sdkclient.ip("8.8.8.8")— and you're done.
The full OpenAPI spec and request playground are at csv2geo.com/api/docs.
Use our batch geocoding tool to convert thousands of addresses to coordinates in minutes. Start with 100 free addresses.
Try Batch Geocoding Free →