An IP geolocation API takes an IP address and gives back a structured record of where that address is and what network it belongs to. A typical response has
- country, region, and city
- coordinates with an accuracy radius
- a timezone, the ISP, or the hosting company
- the autonomous system number, and
- flags for VPNs, proxies and Tor.
You call it from a signup form, a checkout, a log pipeline, or a CDN edge function and act on the answer.
Four jobs cover most of the demand.
- Localization picks a language, currency and timezone before the user does anything.
- Compliance and licensing rules gate access by country.
- Fraud and abuse checks look for a proxy, a datacenter range or a location that does not match the account.
- Analytics attributes traffic to regions without cookies.
None of these need a precise address; they need a reliable country and a usable guess at the city.
Country-level results are dependable, usually quoted in the high nineties. City-level is an inference drawn from routing data and ISP records. The vendors that publish a figure put it around 60 to 80 percent, and it falls further on mobile networks, carrier-grade NAT and anything behind a VPN.
Building this yourself involves crawling registries, parsing BGP tables, and refreshing it all constantly. This guide compares the best IP geolocation APIs on what they return, how they price it, and how they treat commercial use.
IP geolocation APIs compared
| Provider | Best for | Free tier | Entry paid price | Notable |
|---|---|---|---|---|
| IPstack | A mature, widely-integrated hosted API | 100 lookups/mo, dev only | $12.99/mo, 50,000 lookups | apilayer product with an MCP server; ipapi.com is its twin |
| Abstract API | Location plus security in a signup flow | 1,000 requests/mo | $19/mo, 200,000 requests | Seven security booleans, SOC 2 Type II, sub-20ms responses |
| ipdata | Fraud and abuse screening | 1,500 lookups/day, non-commercial | $10/mo, 2,500 lookups/day | Ten threat flags including iCloud Private Relay, ML trust score |
| WhoisXML | A database-backed feed with wide coverage | 1,000 queries | $29/mo, 100,000 queries | Query by IP, domain or email; one-time credit packs |
| IP-API.com | A quick, keyless lookup | 45 req/min, HTTP, non-commercial | EUR 13.30/mo on annual billing | No signup; JSON, XML, CSV; batch of 100 |
| ipgeolocation.io | Predictable scaling with no feature gates | 1,000 credits/day | $19/mo, 150,000 credits | Same fields on every paid plan; accuracy radius and confidence |
| Ipregistry | The full response on any budget | 20,000 credits, one-time | $29/mo, 100,000 credits | No field gating; one-time packs; 12 SDKs and 8 frameworks |
| DB-IP | Choosing between a hosted API and a local database | Entry API tier plus a downloadable database | EUR 8.29/mo, up to 50,000 req/day | Free downloadable database; place names in 50-plus languages |
| IPinfo | Measurement-based accuracy at city level | Unlimited country-level lookups | $26/mo, 150,000 requests | Probe Net active measurement; accuracy radius on every record |
| MaxMind | The industry baseline dataset | GeoLite: 1,000 lookups/day | $0.0001 per query, pay as you go | Created GeoIP; GeoLite ships with many open-source tools |
| IP2Location | One vendor for both an API and BIN databases | 50,000 lookups/mo, attribution | $49/mo, 150,000 lookups | Up to 79 fields; AI-crawler detection; free LITE database |
| IPLocate.io | A flat-priced, fully ungated API | 1,000 requests/day, all fields | $25/mo, 100,000 requests | No feature gating; MCP server; free country and ASN databases |
I evaluated each provider on what its API actually returns, IPv4 and IPv6 support, how it licenses free and paid use, and its current published rates for US customers. Pure geocoding services and the Wi-Fi and cell-tower APIs sold under a similar name were left out, since they do not take an IP address as input.
IPstack
IPstack is a long-running hosted API from apilayer, part of Idera. A lookup comes back as roughly 100 JSON fields covering location, currency, timezone, the connecting ISP and a security block. There are three request styles: a single IP, a batch, and a keyless call that returns the caller’s own location. apilayer also sells a nearly identical twin, ipapi.com, at the same prices. Microsoft, Airbnb, and Samsung are listed as its customers.

Key Features
- Single, bulk and requester lookup endpoints, the last of which needs no IP passed in.
- IPv4 and IPv6 support across more than 200,000 cities.
- A security module that flags VPNs, proxies and threat levels.
- An official MCP server, so an AI agent can call the API as a tool without an SDK.
- JSON or XML responses, with SDKs and a Postman collection.
Pros & Cons
PROS
CONS
Pricing
Billed monthly; annual billing is up to 15 percent cheaper.
– Free: 100 lookups/month, development and testing only
– Basic: $12.99/month, 50,000 lookups
– Professional: $59.99/month, 500,000 lookups
– Professional Plus: $99.99/month, 2,000,000 lookups
– Custom: contact sales for higher volume
Abstract API
The Abstract IP Geolocation API is designed to drop into a signup or checkout. One call returns city-level location, the ISP, a connection type, currency, a country flag as SVG or PNG, and seven security booleans covering VPN, proxy, Tor, hosting, relay, mobile and abuse.
It covers more than 4 billion IPv4 and IPv6 addresses and refreshes daily. It is SOC 2 Type II and GDPR compliant, which matters once the location data counts as personal data.

Key Features
- A security object returned as plain booleans: is_vpn, is_proxy, is_tor, is_hosting, is_relay, is_mobile and is_abuse.
- Country flags in emoji, Unicode, PNG and SVG form.
- Connection type down to DSL, cellular or satellite.
- A list of other domains hosted on the same IP.
- Threat intelligence drawn from more than 250 proprietary feeds.
- Native Python, PHP, and Node libraries plus an in-browser request sandbox.
Pros & Cons
PROS
CONS
Pricing
Annual billing saves 10 percent.
– Free: $0, 1,000 requests/month, one request per second
– Starter: $19/month, from 200,000 requests/month
– Standard: $35/month, adds company data
– Professional: $39/month, adds the security block and hosted domains
– Enterprise: custom, adds a commercial SLA and dedicated support
ipdata
ipdata pairs geolocation with a heavy security layer. Every response can carry ten threat booleans, including a flag for Apple’s iCloud Private Relay, alongside four separate confidence scores and checks against more than 100 threat feeds. Its customer list includes NASA’s Jet Propulsion Lab, Disney and Cisco, and around 40,000 developers use it.

Key Features
- A threat block covering Tor, VPN, proxy, datacenter, iCloud Private Relay, bogon, and known attacker or abuser status.
- Separate
vpn_score,proxy_score,threat_score, andtrust_scorevalues, not a single verdict. - A usage-type label that marks an IP as an ISP, a datacenter, or a business.
- The company name and domain behind the address.
- Official client libraries and a command-line tool.
Pros & Cons
PROS
CONS
Pricing
Billed monthly, with 20 percent off annual billing.
– Free: 1,500 requests/day, non-commercial use only
– Personal: $10/month, 2,500 requests/day
– Startup: $50/month, 50,000 requests/day, adds company data
– Business: $120/month, 100,000 requests/day
– Enterprise: custom, adds data downloads and a 99.999 percent SLA
WhoisXML IP Geolocation API
Best known for WHOIS and DNS data, WhoisXML API also sells a database-backed IP Geolocation API. It claims coverage of about 99.5 percent of active IP addresses across 291,000 locations and 235,000 ISPs, and you can query it by IP address, domain name or email. Its customer base includes security vendors: Trend Micro, Proofpoint, RSA and Akamai are on the list.
Key Features
- Lookups by IPv4, IPv6, domain, or email address.
- AS details including the routed prefix and an ASN-type label such as ISP, content, or education.
- A downloadable data feed in CSV or JSON alongside the live API.
- A shared credit balance that also covers WhoisXML’s WHOIS, DNS and threat APIs.
Pros & Cons
PROS
CONS
Pricing
Sold monthly, yearly or as one-time credit packs.
– Free: 1,000 queries
– Monthly: from $29 for 100,000 queries, up to $499 for 10 million
– One-time: from $49 for 100,000 queries, credits with no subscription
– Custom: contact sales for higher volume
IP-API.com
IP-API gets you a location with no signup at all. Send an unauthenticated request to ip-api.com and you get JSON, XML, CSV or newline text with city, region, ZIP, coordinates, timezone, ISP and AS number. The free endpoint allows 45 requests a minute, is limited to non-commercial use and works over plain HTTP only. A paid Pro plan adds HTTPS, commercial rights, and unlimited volume.

Key Features
- No API key on the free endpoint, so a script works in one line.
- A batch endpoint that resolves up to 100 addresses per request.
- Responses in JSON, JSONP, XML, CSV, newline text, or serialized PHP.
Pros & Cons
PROS
CONS
Pricing
Free for non-commercial use; Pro is billed in euros.
– Free: 45 requests/minute, HTTP only, non-commercial
– Pro: EUR 13.30/month on annual billing, or EUR 15/month on a shorter term, with HTTPS, commercial use and unlimited requests
– Enterprise: custom, with a dedicated-server option
ipgeolocation.io
ipgeolocation.io returns one unified response and charges by credit rather than by request. A basic lookup costs one credit. Adding the security block costs more, and live VPN and proxy detection is billed per call. Every paid plan carries the same fields, so you scale by buying more credits, not by upgrading to unlock data.

Key Features
- One endpoint that returns geolocation, ASN, company, currency, timezone, an accuracy radius, and a confidence label.
- A security block with residential-proxy and known-attacker flags plus a threat score.
- An abuse-contact lookup that returns the network’s reporting email and phone.
- User-agent parsing for device, operating system, and browser.
- Bulk lookups and place names in multiple languages.
- No rate limits on any plan, including the free one.
Pros & Cons
PROS
CONS
Pricing
Credit-based, with annual billing about 17 percent cheaper. A standard lookup is one credit; the security block adds more, and live VPN and proxy detection is billed per call.
– Free: 1,000 credits/day
– Starter: $19/month, 150,000 credits/month
– Plus: $49/month, 500,000 credits/month
– Business: $129/month, 2,000,000 credits/month
– Enterprise: contact sales, unlimited
Ipregistry
Ipregistry sells a complete response and never holds fields back for a higher plan. City-level location, ASN, company, carrier, currency, timezone and VPN and proxy detection all come back on the first call, whether you are on a free trial or an enterprise contract. Coverage reaches about 99.99 percent of IPv4 and IPv6 addresses in use, and it names Accenture and Coinbase among 51,000 organizations using it.

Key Features
- A response header that returns your remaining credit count on every call.
- Open-source libraries for 12 languages and 8 web frameworks, with response caching and batch lookups.
- Threat data refreshed roughly every 15 minutes against more than 220 feeds.
- Downloadable datasets regenerated daily in CSV and MMDB for offline lookups.
- Anycast routing from data centers on five continents.
Pros & Cons
PROS
CONS
Pricing
Start with 20,000 free credits, then subscribe or buy one-time packs. Annual plans include two months free.
– Free: 20,000 credits, one-time
– Starter: $29/month, 100,000 credits/month
– Professional: $79/month, 300,000 credits/month
– One-time packs: from $10 for 15,000 credits, up to $500 for 1,750,000
– Enterprise: from $299/month with overage protection and an SLA
DB-IP
DB-IP offers the same location data two ways: a hosted JSON API and databases you download in CSV or MMDB and query locally. The dataset spans more than 44 million IPv4 and IPv6 blocks, refreshes daily, and localizes place names into over 50 languages. Pricing is in euros, and there is a free option on both the API and the database.

Key Features
- Matching hosted API and downloadable database, so you can move between them without changing your data model.
- Three API tiers, Basic, Core, and Extended, that add ISP, organization, and connection data as you move up.
- Batch queries of up to 256 addresses.
- A free Lite database under a Creative Commons Attribution licence.
Pros & Cons
PROS
CONS
Pricing
Billed monthly in euros; each paid API tier has a free trial.
– Free: an entry-level API tier, and the downloadable Lite database
– Basic API: from EUR 8.29/month for 2,000 to 50,000 requests/day
– Premium API: EUR 99.90/month for up to 1,000,000 requests/day
– Enterprise API: EUR 499.90/month, unlimited
– Commercial databases: quoted separately
IPinfo
IPinfo operates its own measurement network instead of leaning on public databases. Its Probe Net platform takes active measurements from more than 1,000 points of presence and reaches 44 percent of the world’s networks within a millisecond. It uses that to place addresses at the city level. The free Lite plan returns country and ASN data with no request cap; the paid plans add city-level data and the privacy flags.
Key Features
- Probe Net active measurement instead of a static third-party database.
- An accuracy radius and a last-changed timestamp on every geolocation record.
- A free Lite tier with unlimited country-level requests.
- Libraries for a dozen languages and native listings on Snowflake, Google Cloud, and Splunk.
Pros & Cons
PROS
CONS
Pricing
Annual billing includes two months free.
– Lite: $0, unlimited country-level and ASN lookups, attribution required
– Core: $26/month, 150,000 requests/month, adds city-level data and VPN, proxy and Tor detection
– Max: $163/month, 250,000 requests/month, adds carrier and residential-proxy detection
– Enterprise: custom, for more than a million requests a month
– Database downloads: from $1,000/month
MaxMind
MaxMind coined the term GeoIP and has kept the reference dataset for this category for more than 20 years. It sells two things: the paid GeoIP web services and databases and the free GeoLite dataset that many open-source geolocation libraries build on. The web services are pay-as-you-go with no minimum, priced per query by how much detail you ask for.

Key Features
- Three query tiers, Country, City Plus, and Insights, that add ISP and coordinates, then anonymizer detection, a risk score, and confidence factors.
- A free GeoLite web service and database behind a free account and license key.
- An accuracy radius on every coordinate pair, which MaxMind requires you to display.
- Servers on three continents with volume discounts above a spend threshold.
Pros & Cons
PROS
CONS
Pricing
Pay-as-you-go, no commitment, commercial use included. Buy credit from $25.
– GeoIP Country: $0.0001 per query
– GeoIP City Plus: $0.0003 per query, adds city, coordinates and ISP
– GeoIP Insights: $0.002 per query, adds proxy detection and risk scoring
– GeoLite: free with an account and license key, 1,000 web-service lookups per day
– Volume discounts above $2,500/month
IP2Location
IP2Location has sold IP data since 2001 and offers it two ways: IP2Location.io for a hosted JSON API, and IP2Location.com for downloadable BIN databases you query locally. The API tiers step up from basic city and ISP data to VPN, Tor, residential-proxy, datacenter, and AI-crawler detection with a fraud score. A separate LITE database is free for personal and commercial use.

Key Features
- Up to 79 response attributes, from basic geolocation to full anonymizer and crawler detection.
- A keyless endpoint for 1,000 lookups a day that needs no account.
- BIN databases in CSV, BIN, or CIDR with libraries for 30 languages.
- Separate detection categories for AI crawlers and search-engine spiders.
- A LITE database that resolves an address to its class-C block.
Pros & Cons
PROS
CONS
Pricing
Billed monthly in US dollars; the top plan has a 7-day trial.
– Free: 50,000 lookups/month, open-proxy detection only, attribution required
– Starter: $49/month, 150,000 lookups/month
– Plus: $249/month, 300,000 lookups/month, adds VPN, Tor and residential-proxy detection
– Security: $499/month, 600,000 lookups/month, adds datacenter and crawler detection and a fraud score
IPLocate.io
IPLocate is a smaller, developer-first option that does not gate any data behind a plan. Proxy, VPN, Tor, relay and hosting detection, company data, ASN and abuse-contact details are all available on the free tier, which is generous enough for light production use. Paid access is a single flat price, whether you take a monthly quota or a one-time credit pack that never expires.
Key Features
- The API and every downloadable database share one schema, so self-hosting later needs no remapping.
- An official MCP server plus Zapier, Make, and Integrately connectors.
- Free IP-to-country and IP-to-ASN databases, updated daily.
- Abuse-contact and registry data pulled from every RIR and RWHOIS server.
Pros & Cons
PROS
CONS
Pricing
One flat price for paid access; pay yearly for two months free.
– Free: 1,000 requests/day, all fields, no card
– Monthly: $25/month for 100,000 requests
– One-time: $25 for 300,000 credits that never expire
– Custom: contact sales for millions of requests and an SLA
– Databases: from $100/month, or free for country and ASN data
How to choose
Start with the license, not the price. IP-API’s free tier is non-commercial and HTTP-only. ipdata’s free tier bars commercial use. IPinfo Lite, MaxMind GeoLite and IP2Location’s free API all need visible attribution. Only a few options are free to ship on with no strings: MaxMind GeoLite and DB-IP Lite as downloadable databases, IPLocate’s free tier, and IP2Location’s LITE database if you show attribution. Everywhere else, the real entry cost is the first paid plan.
Decide next whether you want a hosted call or a local file. A hosted API is one request and always current, but it adds network latency and a rate limit to every lookup. A downloadable database works inside your own process with no per-call cost, which fits log enrichment and high-throughput batch jobs. MaxMind, DB-IP, IPinfo, IP2Location, Ipregistry and IPLocate all offer one, so you can prototype against the API and move to the file later.
Match the security depth to the job. For plain localization, IPstack, DB-IP or IP-API return enough data. For fraud and abuse work you want proxy, VPN, datacenter, and residential-proxy flags with confidence scores: ipdata, Ipregistry, IP2Location’s higher plans and IPinfo Max all carry them. Watch which tier unlocks them, because on several providers, the anonymizer fields are the reason to leave the entry plan.
Finally, set your accuracy expectations before you design around the data. Treat the country as solid and the city as a hint. IPinfo, MaxMind, ipgeolocation.io and Abstract return an accuracy radius; read it. Fall back to the region when the radius is wide, or when the response flags a VPN, a hosting range or a mobile network.
Frequently Asked Questions
Several, with conditions. IP-API is free with no key for non-commercial use at 45 requests a minute over HTTP. IPinfo Lite gives unlimited country-level and ASN lookups if you show an attribution. MaxMind GeoLite allows 1,000 web-service queries a day behind a free account and license key. ipdata and ipgeolocation.io have permanent free tiers, though ipdata’s is non-commercial. IPLocate allows 1,000 requests a day with every field included. For a commercial product with real traffic, the practical entry cost is the first paid tier.
Country-level accuracy is dependable, usually quoted in the high nineties. IP2Location, for example, publishes about 98 percent for its free database and 99.5 percent for its commercial one. City-level is far looser, roughly 60 to 80 percent depending on the country. It is worse in rural areas, on mobile networks, behind carrier-grade NAT and through a VPN or proxy. On those connections the address points to a carrier hub or the VPN’s exit node, not the user. Use the accuracy radius where a provider returns one, and treat a wide radius as a signal to fall back to the region.
No. The Google Maps Geolocation API estimates a device’s location from nearby cell towers and Wi-Fi access points that your app includes in the request body. It also needs a billing-enabled Google Cloud project. It never takes the caller’s IP address as input. It solves a different problem: locating a device that can share network hardware, not an arbitrary IP from a server log.
Yes. MaxMind GeoLite offers free country and city databases under its license with a free account and attribution. DB-IP publishes free Lite databases under a Creative Commons Attribution license. IP2Location’s LITE database is free for personal and commercial use. IPLocate gives away IP-to-country and IP-to-ASN files. All of them trade some coverage, accuracy, and update frequency against the paid versions.
Every provider in this guide supports IPv6 lookups alongside IPv4. Accuracy on IPv6 depends on how each ISP assigns and documents its address blocks, so it can be coarser than IPv4 in practice. The API call and the response fields are the same either way.
