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
| Provider | Delivery | Free tier | Cheapest paid plan | VPN / proxy detection | Batch per request |
|---|---|---|---|---|---|
| ipbase | API | 1,000 requests a month with city data, for testing and personal projects | $9.99 a month for 65,000 requests | From Medium ($39.99 a month) | 1,000 (POST), free plan included |
| IPinfo | API and databases | Lite: unlimited, country and ASN only, attribution required | Core: $31 a month ($26 a month billed yearly) for 150,000 requests | From Core | 1,000 |
| MaxMind | Databases and web services | GeoLite databases with an account and license key, attribution required | Web service, pay per query: City Plus $0.30 per 1,000 | Insights web service, Anonymous IP database | None documented |
| ip-api.com | API | 45 requests a minute, no key, HTTP only, non-commercial | Pro: €13.30 a month paid for 12 months, unlimited | proxy field | 100 |
| ipstack | API | 100 requests a month, non-commercial | Basic: $12.99 a month for 50,000 | Professional Plus ($99.99 a month) | 50 (Professional Plus) |
| ipgeolocation.io | API and databases | 1,000 credits a day, for evaluation and testing | Starter: $19 a month for 150,000 credits | Every paid plan (2 extra credits per lookup) | 50,000 (paid plans) |
| IP2Location | API (ip2location.io) and databases | API: 50,000 queries a month with attribution; free LITE databases | Starter: $49 a month for 150,000 | VPN and Tor from Plus ($249 a month) | 1,000 (paid plans) |
How to choose
- Country only, any volume: IPinfo Lite (free, unlimited, attribution required), or a free local database such as MaxMind GeoLite or IP2Location LITE.
- 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.
- No outbound requests allowed, or lookups inside a hot loop: a local database (MaxMind GeoIP or GeoLite, IP2Location) with a scheduled update job.
- Behind Cloudflare and only the country: read the free
CF-IPCountryheader, no API needed. The geo blocking guide shows how. - Enriching logs or lists: look for a batch endpoint, so 1,000 addresses are one HTTP request instead of 1,000.
- A hobby project without HTTPS needs: ip-api.com’s free endpoint, which allows non-commercial use only.
API or local database?
| Hosted API | Local database | |
|---|---|---|
| Lookup speed | A network request per new address (cache the answers) | In-process, no network |
| Freshness | Always the provider’s current data | As fresh as your last download |
| Extra data | VPN, proxy, Tor and hosting flags, ASN, company and abuse contacts | Mostly location; security data is a separate, paid database |
| Maintenance | None | A download job, file reloads, license keys |
| Privacy | Visitor IPs go to the provider | Nothing leaves your servers |
| Cost model | Per request or flat monthly plan | License 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.