Comparison

Best IP geolocation APIs in 2026

API or local database? Free tier or flat rate? Seven IP geolocation options compared on what they return, what the free tier allows and what city-level data with VPN detection costs.

Updated October 29, 2026 · 8 min read

The best IP geolocation API depends on four questions: do you need the city or only the country, do you need VPN and proxy detection, may you send requests to an outside service at all, and how many lookups a month will you make. This comparison covers seven common options, ipbase, IPinfo, MaxMind, ip-api.com, ipstack, ipgeolocation.io and IP2Location, with what their free tiers allow and what city-level data with VPN detection costs.

We make ipbase, so we are not neutral. Every price and limit below comes from the provider’s own pricing page or documentation, read in October 2026. Prices are monthly list prices; ipbase prices exclude VAT.

Quick comparison

ProviderDeliveryFree tierCheapest paid planVPN / proxy detectionBatch per request
ipbaseAPI1,000 requests a month with city data, for testing and personal projects$9.99 a month for 65,000 requestsFrom Medium ($39.99 a month)1,000 (POST), free plan included
IPinfoAPI and databasesLite: unlimited, country and ASN only, attribution requiredCore: $31 a month ($26 a month billed yearly) for 150,000 requestsFrom Core1,000
MaxMindDatabases and web servicesGeoLite databases with an account and license key, attribution requiredWeb service, pay per query: City Plus $0.30 per 1,000Insights web service, Anonymous IP databaseNone documented
ip-api.comAPI45 requests a minute, no key, HTTP only, non-commercialPro: €13.30 a month paid for 12 months, unlimitedproxy field100
ipstackAPI100 requests a month, non-commercialBasic: $12.99 a month for 50,000Professional Plus ($99.99 a month)50 (Professional Plus)
ipgeolocation.ioAPI and databases1,000 credits a day, for evaluation and testingStarter: $19 a month for 150,000 creditsEvery paid plan (2 extra credits per lookup)50,000 (paid plans)
IP2LocationAPI (ip2location.io) and databasesAPI: 50,000 queries a month with attribution; free LITE databasesStarter: $49 a month for 150,000VPN and Tor from Plus ($249 a month)1,000 (paid plans)

How to choose

  1. Country only, any volume: IPinfo Lite (free, unlimited, attribution required), or a free local database such as MaxMind GeoLite or IP2Location LITE.
  2. City plus VPN and proxy detection at a flat monthly price: compare the plan that fits your volume at ipbase, IPinfo Core and ipgeolocation.io. Check what happens above the quota: some plans bill overage per 1,000 requests, others stop.
  3. No outbound requests allowed, or lookups inside a hot loop: a local database (MaxMind GeoIP or GeoLite, IP2Location) with a scheduled update job.
  4. Behind Cloudflare and only the country: read the free CF-IPCountry header, no API needed. The geo blocking guide shows how.
  5. Enriching logs or lists: look for a batch endpoint, so 1,000 addresses are one HTTP request instead of 1,000.
  6. A hobby project without HTTPS needs: ip-api.com’s free endpoint, which allows non-commercial use only.

API or local database?

Hosted APILocal database
Lookup speedA network request per new address (cache the answers)In-process, no network
FreshnessAlways the provider’s current dataAs fresh as your last download
Extra dataVPN, proxy, Tor and hosting flags, ASN, company and abuse contactsMostly location; security data is a separate, paid database
MaintenanceNoneA download job, file reloads, license keys
PrivacyVisitor IPs go to the providerNothing leaves your servers
Cost modelPer request or flat monthly planLicense per year or month; free databases need attribution

Many teams combine both: a local country database at the edge for routing, and an API call for the few requests that need more, such as sign-ups and payments.

The providers in detail

ipbase

A JSON API: location with city, region and coordinates, connection (ASN, ISP), time zone and currency on every plan including the free one; the security flags (VPN, proxy, Tor, iCloud Private Relay, data center, threat score) from the Medium plan. Every location says how exact it is with precision, accuracy_radius_km and confidence. Batch lookups take 1,000 addresses per POST on every plan. There is no downloadable database. Plans and prices, documentation.

Good for: city data with VPN detection at a low, flat monthly price; batch enrichment. Watch out for: the free plan’s per-minute limit (10 requests) and that free keys get the security fields as null.

IPinfo

API and data downloads. IPinfo Lite is free without usage limits and includes country, continent and ASN, but no city; it is licensed under CC BY-SA 4.0 and may be used commercially with attribution. Core ($31 a month, or $310 a year) adds city-level data and privacy detection (VPN, Tor, proxy, relay) for 150,000 requests and bills $0.34 per extra 1,000. Max adds residential proxy detection. The batch endpoint groups up to 1,000 lookups.

Good for: free country lookups at any volume; large data downloads. Watch out for: the headline Core price assumes yearly billing. Our ipbase vs IPinfo page does the cost math by volume.

MaxMind (GeoIP and GeoLite)

The long-standing standard for local databases. GeoLite, the free edition (formerly GeoLite2), needs a MaxMind account and a license key, requires attribution, and the country and city databases are updated every Tuesday and Friday. Read the GeoLite EULA for your use: it grants a CC BY-SA license, and MaxMind also sells a separate commercial GeoLite license. The paid GeoIP City database lists at $148 a month. The web services are pay as you go: Country $0.10, City Plus $0.30 and Insights $2.00 per 1,000 queries, with proxy and anonymizer detection in Insights.

Good for: on-premise lookups, nginx and CDN integrations. Watch out for: update jobs and license terms; one address per web service request.

ip-api.com

A simple API. The free endpoint of ip-api.com needs no key and allows 45 requests a minute. Its documentation says SSL is not available on the free API, and its terms limit free use to non-commercial purposes. The response includes the city and a proxy field. Batch requests to ip-api.com take up to 100 addresses. Pro costs €13.30 a month when paid for 12 months (€160; the shortest term is 3 months for €45) and adds HTTPS, commercial use and unlimited requests.

Good for: hobby projects and internal tools. Watch out for: HTTP only and no commercial use on the free endpoint.

ipstack

A location API with request-based tiers. The free plan of ipstack has 100 requests a month and is not for commercial use. Basic costs $12.99 a month for 50,000 requests with city data, and requests above the quota are billed as overage. At ipstack, the security module (proxy, VPN and Tor detection) and bulk lookups of up to 50 addresses need Professional Plus at $99.99 a month.

Good for: location-only lookups at mid volume. Watch out for: VPN detection and bulk lookups only on Professional Plus.

ipgeolocation.io

API and database products. The free plan gives 1,000 credits a day with city data; its terms describe free use as evaluation, testing and prototypes. Starter costs $19 a month for 150,000 credits. Security data is on every paid plan and costs 2 extra credits per lookup. Bulk requests to ipgeolocation.io take up to 50,000 addresses on paid plans.

Good for: very large bulk requests. Watch out for: credits, not requests: a lookup with security data uses 3.

IP2Location

Databases (ip2location.com) and an API (ip2location.io). The free LITE databases may be used commercially with attribution and are updated monthly. The free API plan includes 50,000 queries a month with a key and requires attribution. Starter costs $49 a month for 150,000 queries; VPN and Tor detection start with Plus at $249 a month, while the lower plans detect open proxies only. IP2Location.io bulk queries take up to 1,000 addresses on paid plans.

Good for: a free database you can ship, a generous free API tier. Watch out for: VPN detection only from Plus.

Test with your own traffic

Accuracy claims are hard to compare across providers, and your traffic is not average traffic. A practical test: take a few thousand recent orders or sign-ups where you know the country from the billing address, look up their IP addresses and count how often the countries match. This script does it with the ipbase batch endpoint in a handful of requests:

# compare.py – how often does the IP country match a country you know, e.g. the billing country?
# Usage: IPBASE_KEY=... python compare.py customers.csv   (columns: ip,country)
import csv
import os
import sys
from collections import Counter

import requests


def ip_countries(ips: list[str]) -> dict[str, str | None]:
    unique = list(dict.fromkeys(ips))
    countries: dict[str, str | None] = {}
    with requests.Session() as session:
        session.headers["apikey"] = os.environ["IPBASE_KEY"]
        for start in range(0, len(unique), 1000):  # up to 1,000 addresses per POST
            res = session.post(
                "https://api.ipbase.com/v2/batch",
                params={"fields": "ip,location.country.alpha2"},
                json={"ips": unique[start : start + 1000]},
                timeout=60,
            )
            res.raise_for_status()
            for ip, row in res.json()["data"].items():
                countries[ip] = ((row.get("location") or {}).get("country") or {}).get("alpha2")
    return countries


def main(path: str) -> None:
    with open(path, newline="") as f:
        rows = list(csv.DictReader(f))
    found = ip_countries([row["ip"] for row in rows])
    total, match = Counter(), Counter()
    for row in rows:
        expected = row["country"].strip().upper()
        total[expected] += 1
        match[expected] += found.get(row["ip"]) == expected
    for country, n in total.most_common(10):
        print(f"{country}: {match[country]} of {n} match ({match[country] / n:.0%})")
    print(f"all: {sum(match.values())} of {sum(total.values())} match")


if __name__ == "__main__":
    main(sys.argv[1])

Run the same file through every provider on your shortlist; only the lookup function changes. Mismatches are not always errors (travelers, VPN users, company networks), but a provider that is wrong for your main markets shows up quickly. We ran the script with Python 3.15 against a local stub of the API. The IP geolocation tutorial has single lookups in Node.js, Python and PHP.

See ipbase vs IPinfo for a detailed comparison, or check any address with the free IP lookup.

Frequently asked questions

What is the best IP geolocation API?

It depends on what you need. For country and ASN only, IPinfo Lite is free and unlimited. For city-level data with VPN and proxy detection at a flat monthly price, compare ipbase, IPinfo Core and ipgeolocation.io. If no request may leave your servers, use a local database from MaxMind or IP2Location.

What is the most accurate IP geolocation provider?

At country level, the major providers agree on most addresses. At city level, accuracy varies by region and connection type, especially on mobile networks. Test with a sample of your own traffic, for example by comparing the IP country with your customers' billing country, before you decide.

Is there a free IP geolocation API?

Several, with different limits (as of October 2026). IPinfo Lite covers country and ASN without usage limits, with attribution. The free endpoint of ip-api.com allows 45 requests a minute over HTTP, for non-commercial use. The free plan of ipgeolocation.io gives 1,000 credits a day. IP2Location.io includes 50,000 queries a month with attribution. At ipbase, the free plan includes 1,000 requests a month with city data, for testing and personal projects.

Should I use a local GeoIP database or an API?

A local database (MaxMind GeoIP or GeoLite, IP2Location) answers in-process and works offline, but you must download updates on a schedule and it usually has location data only. An API is always current, includes extras such as VPN detection and ASN data, and needs no maintenance, at the cost of a network request per new address.

Which IP geolocation APIs detect VPNs?

ipbase from the Medium plan, IPinfo from Core, ipgeolocation.io on every paid plan, IP2Location.io from Plus, ipstack from Professional Plus, and MaxMind in its Insights web service and its Anonymous IP database. ip-api.com returns a proxy field.

IP geolocation API

Get this data in your app

ipbase returns location, ISP, ASN and time zone for any IPv4 or IPv6 address, up to 1,000 addresses per POST request. Security flags (VPN, proxy, Tor, data center) are on the Medium plan and above.

Read the documentation

1,000 free requests every month. No credit card required.

GET https://api.ipbase.com/v2/info?ip=1.1.1.1

{
  "data": {
    "ip": "1.1.1.1",
    "type": "v4",
    "connection": {
      "asn": 13335,
      "organization": "APNIC and Cloudflare DNS Resolver project",
      "isp": "Cloudflare, Inc",
      "range": "1.1.1.0/24"
    },
    "location": {
      "country": { "alpha2": "AU", "name": "Australia" },
      "zip": "4000"
    },
    "security": { "is_vpn": null, "is_tor": null, "threat_score": null }
  }
}

Keep reading

Get your free IP geolocation API key

Start with 1,000 free requests a month