[ blog · comparison ]9 min read

Free IP Geolocation APIs in 2026: Accuracy, Rate Limits, and When to Pay

Sarah ChoyPublished July 29, 20269 min read
Free IP Geolocation APIs in 2026: Accuracy, Rate Limits, and When to Pay

IP geolocation looks like a solved problem until you read the fine print: non-commercial-only licenses, HTTP-only free tiers, 100-request monthly caps, or 'free' plans that only return the country. This guide compares the real free options in 2026 — self-hosted GeoLite2, ip-api.com, IPinfo, ipstack, ipgeolocation.io, and API Pick — with honest accuracy numbers and a decision guide.

TL;DR

  • IP geolocation is reliable at country level (>99% accuracy) but city-level accuracy is only 55–80% depending on the country — never trust it for street-level location.
  • Most 'free' IP geolocation APIs restrict commercial use (ip-api.com, ipgeolocation.io), cap you at ~100–30k requests/month (ipstack, IPinfo city data), or serve HTTP only.
  • Self-hosting MaxMind GeoLite2 is genuinely free at any volume, but you own the update pipeline (database refreshes twice weekly) and get lower accuracy than paid GeoIP2.
  • API Pick's IP Geolocation API is pay-as-you-go with no subscription: 1 credit (=$0.001) per lookup, 120 requests/min, IPv4 + IPv6, commercial use included, and you only pay for successful lookups.
  • For AI agents, a JSON-in/JSON-out geolocation tool with API-key auth beats scraping or self-hosted databases — one GET request returns country, city, coordinates, timezone, EU flag, and ASN.

The fine print problem

Searching for a free IP geolocation API returns a dozen providers that all look identical: paste an IP, get a country and city back. The differences only show up in the fine print — and the fine print is where production incidents live. One provider's free tier is HTTP-only, so you leak lookups in cleartext. Another allows non-commercial use only, which your SaaS is not. A third gives you 100 requests per month, which your signup flow burns through before lunch.

This guide compares the options that actually matter in 2026 — self-hosted MaxMind GeoLite2, ip-api.com, IPinfo, ipstack, ipgeolocation.io, and API Pick's IP Geolocation API — on the three axes that decide real projects: what the license actually permits, what the free tier actually includes, and what the data is actually accurate enough for.

What IP geolocation can and cannot tell you

Before comparing providers, calibrate expectations — because every provider draws from similar underlying data, and that data has hard physical limits:

  • Country: better than 99% accurate. Country-level identification is the reliable part of IP geolocation and the basis for geo-blocking, tax jurisdiction, and content licensing decisions.
  • City: roughly 55–80% within ~50 km. MaxMind's own published accuracy figures vary this widely by country. Urban ISPs resolve well; rural, mobile, and CGNAT connections resolve to the wrong city routinely.
  • Street level: never. The latitude/longitude in any IP geolocation response is the estimated center of the matched area, not a device position. Treating it as GPS has ended in lawsuits — the infamous Kansas farm case, where a default map center placed millions of "unknown" IPs on one family's property, is the canonical warning.
  • VPNs geolocate to the exit node. The asn field is your screen: a "residential ISP" ASN suggests a real user location; a hosting-provider ASN means the location is the datacenter's.

The contenders, honestly

Self-hosted MaxMind GeoLite2

The free downloadable database that most free APIs are built on. You register a MaxMind account, download the City/Country/ASN MMDB files, and query them in-process with a reader library — sub-millisecond lookups, unlimited volume, genuinely free including commercial use (with EULA attribution requirements).

The cost is operational: databases update twice a week and stale data degrades fast in mobile IP space; you own the refresh pipeline, the deployment surface, and the memory footprint on every host. And GeoLite2 is the reduced-accuracy sibling — MaxMind's paid GeoIP2 databases resolve measurably better, which is exactly why they can charge for them.

ip-api.com

Generous limits (45 requests/min) and no API key needed — but the free tier is licensed for non-commercial use only and served over HTTP only. If you're building anything that bills anyone, or you don't want IP lookups readable in transit, you're on the paid plan.

IPinfo

Excellent data quality and a genuinely free country + ASN tier. City-level data, however, sits behind paid plans that start at real subscription money. If country resolution is all you need, it's a strong free choice; if you need city and coordinates, budget for it.

ipstack & ipgeolocation.io

ipstack's free plan is around 100 requests/month with HTTPS reserved for paid tiers — a demo allocation, not an operating budget. ipgeolocation.io is more generous (about 1k requests/day) but again limits the free tier to non-commercial projects. Both push you toward monthly subscriptions the moment you're real.

API Pick IP Geolocation

API Pick's endpoint takes the other pricing route: no subscription, no monthly cap — 1 credit per lookup at $1 = 1,000 credits, so a lookup costs $0.001, and only successful lookups are billed. Failed queries (private IPs, addresses with no data) cost nothing. Commercial use is included, everything is HTTPS, and both IPv4 and IPv6 are covered. New accounts get 100 free credits — 100 real lookups to evaluate with, no card required.

One request returns the full record: country code and name, region, city, latitude/longitude, timezone, an EU-membership flag (useful for GDPR-conditional flows), and the ASN for VPN/datacenter screening. Lookups run against a locally hosted MaxMind database, so there's no third-party call in your latency path. Rate limit: 120 requests/min per key.

Side by side

Free-tier terms as published at the time of writing (July 2026). Always verify current terms — free tiers change without notice.
GeoLite2 (self-host)ip-api.comIPinfoipstackAPI Pick
Truly free tierUnlimited, self-run45 req/minCountry+ASN only~100 req/month100 lookups (signup credits)
Commercial use (free)Yes (EULA)NoYesYesYes
HTTPS on free tiern/a (local)NoYesNoYes
City-level dataYes (reduced accuracy)YesPaidYesYes
Pricing modelFree + your ops timeSubscriptionSubscriptionSubscriptionPay-per-lookup ($0.001)
MaintenanceYou (2×/week updates)NoneNoneNoneNone
ASN / VPN signalSeparate ASN DBPaid fieldsYesPaidIncluded
Agent-ready authn/aNo key (free)TokenKeyx-api-key header

Calling the API

The request shape is a single GET. Omit the ip parameter and the API looks up the caller's own address — useful for client-side personalization:

curl "https://www.apipick.com/api/ip-geolocation?ip=8.8.8.8" \
  -H "x-api-key: YOUR_API_KEY"

Response:

{
  "ip": "8.8.8.8",
  "country_code": "US",
  "country_name": "United States",
  "region": "California",
  "city": "Mountain View",
  "latitude": 37.4223,
  "longitude": -122.085,
  "timezone": "America/Los_Angeles",
  "is_eu": false,
  "asn": 15169
}

In Python, with the standard requests library:

import requests

def geolocate(ip: str) -> dict:
    r = requests.get(
        "https://www.apipick.com/api/ip-geolocation",
        params={"ip": ip},
        headers={"x-api-key": API_KEY},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()

geo = geolocate("2001:4860:4860::8888")  # IPv6 works too
print(geo["country_code"], geo["city"], geo["asn"])

Wiring it into an AI agent

IP geolocation is a natural agent tool: deterministic input, structured output, one authenticated call. A support-triage agent enriches tickets with the requester's country and timezone; a fraud agent cross-checks the signup country against the card country and flags hosting-provider ASNs. The OpenAI/Anthropic tool schema is minimal:

{
  "name": "ip_geolocation",
  "description": "Look up country, city, coordinates, timezone, EU flag and ASN for a public IPv4/IPv6 address.",
  "input_schema": {
    "type": "object",
    "properties": {
      "ip": { "type": "string", "description": "Public IP address to look up" }
    },
    "required": ["ip"]
  }
}

Decision guide

  • Hobby project, no revenue, low volume: ip-api.com's free tier is the fastest start — accept the HTTP-only limitation.
  • Country-level only (geo-blocking, currency defaults): IPinfo's free country tier or a self-hosted GeoLite2 Country database.
  • Millions of lookups, in-house infra team: self-host GeoLite2 (or paid GeoIP2 for accuracy) and automate the update pipeline.
  • Commercial product, city-level data, no subscription appetite: pay-as-you-go — at $0.001 per lookup, 50,000 lookups cost $50 with API Pick, versus a comparable monthly subscription whether you use it or not.
  • AI agent tool: an authenticated JSON API beats a local database — no deployment coupling, and the agent's tool schema maps 1:1 to the endpoint. Grab a key, wire the schema above, done.

Try it live in the interactive demo — 100 free lookups come with every new account, no card required.

Frequently Asked Questions

Is there a completely free IP geolocation API?

Yes, with trade-offs. ip-api.com is free for non-commercial use at 45 requests/min over HTTP only. IPinfo's free tier serves country and ASN (not city) data. Self-hosting MaxMind GeoLite2 is free at any volume but you maintain the database updates yourself. If you need commercial use, HTTPS, and city-level data without a subscription, pay-as-you-go pricing like API Pick's $0.001 per lookup is usually cheaper than the first paid tier of subscription providers.

How accurate is IP geolocation?

Country-level identification is better than 99% accurate across major databases. City-level accuracy drops to roughly 55–80% within ~50 km, varying by country and provider — the published MaxMind figures show wide per-country variation. IP geolocation can never reliably resolve a street address or an exact GPS position; coordinates returned are the estimated center of the matched area.

Is using IP geolocation compatible with GDPR?

IP addresses are personal data under GDPR (CJEU, Breyer v Germany). Deriving a coarse location for fraud prevention, content localization, or geo-blocking is commonly handled under legitimate interest, and country-level lookups are far less invasive than tracking. You still need to list it in your processing records and privacy policy — and consult counsel for your specific case.

Does IP geolocation work for IPv6 addresses?

Yes — modern databases (MaxMind GeoLite2/GeoIP2 and the APIs built on them, including API Pick) cover both IPv4 and IPv6. Accuracy characteristics are similar, though IPv6 adoption differences by region can affect city-level precision.

Should I self-host a GeoIP database or call an API?

Self-host (GeoLite2 MMDB + a reader library) when you do millions of lookups, need sub-millisecond latency in-process, and can automate twice-weekly database updates. Call an API when you want zero maintenance, always-current data, usage-based cost, and a tool AI agents can call directly. The crossover point is typically around a few hundred thousand lookups per month.

Can IP geolocation detect VPNs and proxies?

Not directly — a VPN user geolocates to the VPN exit node, not their real location. The ASN (autonomous system) field is the practical signal: if the ASN belongs to a hosting provider or known VPN operator rather than a consumer ISP, treat the location as unreliable. API Pick returns the ASN with every lookup for exactly this kind of screening.

How do AI agents use an IP geolocation tool?

As a function-calling tool: the agent passes an IP address, the tool returns structured JSON (country, city, coordinates, timezone, EU flag, ASN), and the agent reasons over it — for fraud triage, support-ticket enrichment, or compliance routing. A single authenticated GET request with a JSON response fits the OpenAI and Anthropic tool-use interfaces without any parsing glue.

APIs used in this article

Sarah Choy
Written by
Sarah Choy
CEO, API Pick

Sarah Choy is the CEO of API Pick. She writes about building production-ready APIs for AI agents and LLM workflows.