Best IP Geolocation API for Indie Developers (2026)

If your app runs on Vercel or Cloudflare, you may not need an IP geolocation API at all: both platforms hand you the visitor's country in a request header for free. If you need an API, IPinfo Lite is free with no request cap for country and ASN, ipapi.is gives 1,000 full lookups a day for any purpose, and MaxMind or IP2Location LITE databases let you self-host. Here is what each free tier actually allows.

Editorial title card reading "Best IP Geolocation API for Indie Developers (2026)" beside the orange ZeroRaised mark.

Key takeaways

  • On Vercel, every request carries x-vercel-ip-country plus region, city, latitude, longitude, timezone and postal code headers. Cloudflare adds CF-IPCountry on all plans, including Free.
  • IPinfo Lite is free with no request cap for country and ASN data, and its data is licensed CC BY-SA 4.0, which allows commercial use with attribution.
  • ip-api.com's free endpoint is limited to non-commercial use at 45 requests per minute; commercial use needs Pro, from 13.3 euros a month on an annual plan.
  • VPN and proxy detection is almost never free: ipgeolocation.io, ipdata, ipapi.is and MaxMind all put it on paid plans or paid add-ons.
  • Country lookups are reliable enough for PPP pricing and currency display. City data is approximate: MaxMind's own table shows 70% of UK IPs located within 50 km.
On this page 28
  1. TL;DR
  2. What you actually need geolocation for
  3. Comparison table
  4. The zero-cost options: Vercel and Cloudflare headers
  5. Vercel
  6. Cloudflare
  7. The APIs, one by one
  8. IPinfo Lite: best free country and ASN
  9. ipapi.is: generous free tier, commercial allowed
  10. ipgeolocation.io: free Developer plan with city
  11. ipdata: city for the first 1,000, then country forever
  12. IP2Location.io: biggest monthly free allowance
  13. ipapi.co: a trial, not a free tier
  14. ip-api.com: fine for side projects, not for your SaaS
  15. Self-hosted databases
  16. MaxMind GeoLite and GeoIP
  17. IP2Location LITE
  18. Accuracy: what to trust
  19. Privacy: an IP address can be personal data
  20. Picks by situation
  21. Frequently asked questions
  22. What is the best free IP geolocation API for a commercial SaaS?
  23. Can I use ip-api.com in a commercial product?
  24. Do I need an API if my app is on Vercel or Cloudflare?
  25. How accurate is IP geolocation?
  26. Is an IP address personal data under GDPR?
  27. Ship it, then launch it
  28. Sources

Short answer: If your app is hosted on Vercel or Cloudflare, read the visitor's country from the free request header the platform already sends and skip the API. If you need an API, use IPinfo Lite for free country and ASN lookups with no request cap, ipapi.is if you want 1,000 full city-level lookups a day that you may use commercially, and a MaxMind GeoLite or IP2Location LITE database if you want to self-host. Pay for VPN detection only when signup fraud is costing you money.

Every free allowance, licence term and price below comes from the vendor's own pricing, terms or docs page, checked on 22 Nov 2026. The picks are ours and are marked as such.

TL;DR#

  • Zero-cost first: Vercel sends x-vercel-ip-country and city-level headers to every deployment (Vercel request headers). Cloudflare's IP geolocation adds CF-IPCountry and is available on Free, Pro, Business and Enterprise (Cloudflare IP geolocation).
  • Best free API for country: IPinfo Lite, free with no usage cap, country plus ASN, CC BY-SA 4.0 data (IPinfo Lite).
  • Best free API with city, commercial allowed: ipapi.is, "1,000 requests per day, every day, with the full response" (ipapi.is pricing).
  • Watch the terms: ip-api.com's free endpoint is non-commercial only (ip-api legal), and ipapi.co's free trial "is not meant for use in production" (ipapi.co pricing).
  • VPN detection costs money almost everywhere, from ipgeolocation.io Starter at $19/mo to MaxMind Insights at $0.002 per query.

Disclosure: ZeroRaised is a launch site for bootstrapped products. We have no commercial relationship with any vendor below and earn nothing if you sign up. Facts come from the linked sources as checked on 22 Nov 2026.

What you actually need geolocation for#

Before picking a vendor, name the job, because it decides how much data you need:

  • PPP pricing and currency display. Country only. A header or a free country lookup is enough. Our PPP pricing guide covers how to set the discounts.
  • Signup and trial fraud signals. Country plus ASN (is this a hosting provider?) and ideally a VPN or proxy flag. See our guide on how to prevent free trial abuse for where geolocation fits next to email and card checks.
  • Compliance, such as blocking sanctioned regions. Country, with the caveat that VPNs defeat it. Treat it as one control, not the only one.
  • Analytics and personalisation. City or region, accepting that it is approximate.

Our read: most indie SaaS products only need country. If that is you, start with the free header or IPinfo Lite and do not pay for city data you will not use.

Comparison table#

OptionFree allowanceCommercial use on freeCity on free?HTTPS on free?VPN/proxy detectionPaid entry price
Vercel headersEvery request on VercelPart of hostingYes (x-vercel-ip-city)Yesx-vercel-waf-source in Priority projects onlyHosting plan
Cloudflare CF-IPCountryEvery proxied requestPart of hostingVia Managed TransformYesTor flagged as T1Free on all plans
IPinfo LiteNo usage capYes, CC BY-SA 4.0 with attributionNo, country and ASNNot verified todayNot verified todayNot verified today
ipapi.is1,000 requests a day"may be used for any purpose, including commercial products"Full responseNot statedVPN database $79/mo$20/mo (20,000/day)
ipgeolocation.io1,000 credits a day"Production and commercial use allowed"YesNot stated"Not available in Free plan"$19/mo (150K credits)
ipdata1,000 city lookups a day, then country unlimited, no key"Commercial use with attribution"Yes, first 1,000Not statedVPN detection on Business$50/mo billed yearly
IP2Location.io50K queries a monthAttribution required; not stated beyond thatYesNot statedFree: open proxies only; VPN on Plus$49/mo (150K)
ipapi.coTrial up to 1,000/day"not meant for use in production"Not statedYesNot mentioned$15/mo (60K)
ip-api.com45 requests a minuteNo, "strictly limited for a non-commercial purpose"YesSSL listed as a Pro featureNot covered herePro from 13.3 euros/mo (annual)
MaxMind GeoLiteDatabase download, or 1,000 web lookups a dayNeeds a "Commercial GeoLite license" for productsYes (GeoLite City)YesInsights web service onlyGeoIP Country $0.0001/query
IP2Location LITEDatabase download"free for personal or commercial use with attribution required"YesDownloadNoPaid databases

The zero-cost options: Vercel and Cloudflare headers#

Vercel#

Vercel's request headers page lists the geolocation headers it sends to each deployment: x-vercel-ip-continent, x-vercel-ip-country ("A two-character ISO 3166-1 country code"), x-vercel-ip-country-region, x-vercel-ip-city, x-vercel-ip-latitude, x-vercel-ip-longitude, x-vercel-ip-timezone and x-vercel-ip-postal-code (Vercel request headers). The page does not attach a plan restriction to these.

There is also x-vercel-waf-source, which flags tor, vpn, proxy, res-proxy and abuse traffic, but Vercel says it is only set in Priority projects and "is absent when the IP address has no traffic source or the project isn't a Priority project."

Here is a minimal Next.js middleware that reads the country and passes it to your pricing page. The header read is straight from Vercel's docs; the cookie logic is our example.

// middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
  const country = request.headers.get('x-vercel-ip-country') ?? 'US';
  const response = NextResponse.next();
  response.cookies.set('country', country, { path: '/' });
  return response;
}

export const config = { matcher: ['/pricing'] };

Cloudflare#

Cloudflare's IP geolocation "adds the CF-IPCountry header to all requests to your origin server" and is listed for Free, Pro, Business and Enterprise (Cloudflare IP geolocation). Switch it on under Network, IP Geolocation, or enable the "Add visitor location headers" Managed Transform, which also adds city, continent, latitude and longitude headers.

Two special values matter for your code: "XX - Used for clients without country code data" and "T1 - Used for clients using the Tor network" (Cloudflare HTTP headers). Handle both before you look up a PPP discount.

Our read: if your site already sits behind either platform, this is the best option for PPP pricing: no key, no extra latency, no rate limits.

The APIs, one by one#

IPinfo Lite: best free country and ASN#

IPinfo describes Lite as free with no usage limits, covering country-level geolocation and ASN data for IPv4 and IPv6 (IPinfo Lite, Lite API docs). The data is released under Creative Commons Attribution-ShareAlike 4.0, which allows commercial use, so you need an attribution line. We could not verify IPinfo's city-level or VPN detection offering or paid prices today, so we do not quote them.

Our read: ASN is the underrated field. Knowing a signup came from a cloud provider's network is a useful fraud hint, and Lite gives it to you free.

ipapi.is: generous free tier, commercial allowed#

The free tier is "1,000 requests per day, every day, with the full response", and the page says "The free tier may be used for any purpose, including commercial products." Paid plans are Basic $20/mo (20,000 a day), Medium $50/mo (100,000), Large $100/mo (500,000) and Business $200/mo (2,000,000), with VPN ($79/mo) and hosting ($89/mo) databases sold separately (ipapi.is pricing).

ipgeolocation.io: free Developer plan with city#

The Developer plan is $0 with 1,000 credits a day and the page states "Production and commercial use allowed." Security data is "Not available in Free plan"; paid plans start at Starter, $19/mo for 150K credits a month, then Plus $49, Pro $79, Business $129 and Premium $249 (ipgeolocation.io pricing).

ipdata: city for the first 1,000, then country forever#

ipdata's free plan is "1,000 city-level a day, then country-level without limit, no key", and its pricing page lists "Commercial use with attribution." Threat blocklists start on Startup ($50/mo billed yearly, 50,000 a day) and VPN detection is on Business ($120/mo billed yearly, 100,000 a day) (ipdata pricing).

IP2Location.io: biggest monthly free allowance#

The Free plan gives 50K geolocation queries a month, with "Attribution Required." Free proxy detection only covers open proxies; VPN detection is on Plus ($249/mo) and Security ($499/mo). Starter is $49/mo for 150K queries (IP2Location.io pricing).

ipapi.co: a trial, not a free tier#

ipapi.co's free option is a trial of "Up-to 1000 / day", and the page says "It is not meant for use in production or deployments." Paid tiers start at $15/mo ($12/mo billed annually) for 60K lookups (ipapi.co pricing).

ip-api.com: fine for side projects, not for your SaaS#

The legal page is clear: "The use of the API is strictly limited for a non-commercial purpose and in a non-commercial environment." The free limit is 45 requests per minute, and exceeding it repeatedly can get your IP "banned for up to 1 hour" (ip-api legal). Pro is "€13.3" per month when paying for 12 months, excluding VAT, with "SSL (HTTPS)", unlimited requests and "Commercial use allowed" (ip-api Pro).

Self-hosted databases#

MaxMind GeoLite and GeoIP#

GeoLite needs a free MaxMind account and licence key. You can download the databases (30 downloads a day) or use the GeoLite web service at 1,000 lookups a day per service. The EULA requires you to "delete GeoLite databases within 30 days of a new release", so automate updates. MaxMind says GeoLite City "is not recommended for commercial use cases" (GeoLite docs), and that you can "Incorporate GeoLite data into your products and services with a Commercial GeoLite license" (GeoLite product page).

If you outgrow it, the paid GeoIP web services are priced per query: Country $0.0001, City Plus $0.0003 and Insights $0.002, and only Insights adds anonymizer (VPN and proxy) detection (GeoIP web services).

IP2Location LITE#

The LITE databases are described as "free for personal or commercial use with attribution required" and include country, region, city, latitude, longitude, ZIP code and time zone (IP2Location LITE). The page notes downloads have moved to ip2location.com, so check the licence there when you download.

Our read: a local database suits high volume or keeping visitor IPs away from third parties. The cost is a refresh cron job and a reader library.

Accuracy: what to trust#

MaxMind publishes the most honest accuracy table we found. For GeoIP City, the share of IPs "Correctly located within 50 km" is 62% in the United States, 70% in the United Kingdom, 52% in Japan and 42% in Italy, and in Hong Kong 71% of IPs had "No city-level data available" (MaxMind accuracy).

Our read: use country for anything with money attached (PPP discounts, blocking), city only for soft personalisation, and let users correct a wrong guess, because VPNs and corporate networks will misplace some real customers.

Privacy: an IP address can be personal data#

The UK ICO lists "internet protocol (IP) addresses" as an example of an online identifier (ICO: identifiers), and the UK GDPR definition of personal data covers people identifiable "by reference to an identifier such as a name, an identification number, location data, an online identifier" (ICO: what is personal data). Practical steps (ours, not legal advice): look up the country and drop the raw IP if you do not need it, name your geolocation vendor in your privacy policy, and prefer a header or local database if you would rather not send IPs to another processor.

Picks by situation#

Your situationOur pick
PPP pricing, app on Vercelx-vercel-ip-country header, $0
PPP pricing, site behind CloudflareCF-IPCountry, free on all plans
PPP pricing, other hostIPinfo Lite (free, no cap, country)
Need city for free in a commercial appipapi.is (1,000 a day) or ipgeolocation.io (1,000 credits a day)
Signup fraud screening on a budgetIPinfo Lite ASN for hosting networks, then ipapi.is VPN database or MaxMind Insights when abuse costs real money
Self-host, no third party sees IPsIP2Location LITE, or MaxMind GeoLite with a commercial licence
High volume, country onlyLocal database, or MaxMind GeoIP Country at $0.0001 a query
Weekend side project, non-commercialip-api.com free endpoint

Illustrative example (our arithmetic): at 300,000 country lookups a month, MaxMind GeoIP Country costs 300,000 x $0.0001 = $30 a month, while a header or IPinfo Lite costs $0.

Frequently asked questions#

What is the best free IP geolocation API for a commercial SaaS?#

For country-level data, IPinfo Lite: it is free with no request cap and its data is licensed CC BY-SA 4.0, which allows commercial use with attribution. If you need city-level data for free, ipapi.is allows 1,000 full lookups a day and says the free tier may be used for any purpose, including commercial products. ipgeolocation.io also allows production and commercial use on its free Developer plan of 1,000 credits a day.

Can I use ip-api.com in a commercial product?#

Not on the free endpoint. ip-api.com's legal page says use of the free API is strictly limited to a non-commercial purpose and environment, and only Pro members can use it commercially. Pro is listed at 13.3 euros a month when paying for 12 months, excluding VAT, and includes SSL and unlimited requests.

Do I need an API if my app is on Vercel or Cloudflare?#

Often not. Vercel sends x-vercel-ip-country, region, city, latitude, longitude, timezone and postal code headers to every deployment. Cloudflare adds CF-IPCountry to requests to your origin on all plans including Free, and its Add visitor location headers Managed Transform adds city, continent, latitude and longitude. For PPP pricing or currency display, the country header is usually enough.

How accurate is IP geolocation?#

Country is reliable enough for pricing and display. City is approximate. MaxMind's own accuracy table reports 62% of US IPs and 70% of UK IPs correctly located within 50 km, and for Hong Kong 71% of IPs had no city-level data. VPNs and corporate proxies also put users in the wrong country.

Is an IP address personal data under GDPR?#

It can be. The UK ICO lists internet protocol (IP) addresses as an example of an online identifier, and the UK GDPR definition of personal data includes online identifiers. Look up the country, store only what you need, and mention the processing in your privacy policy.

Ship it, then launch it#

Geolocation is a small piece of a pricing page that converts worldwide. When the rest is ready, run through our product launch checklist for bootstrapped makers, then launch on ZeroRaised for free. For more tool comparisons for founders building without investors, join the ZeroRaised newsletter.

Sources#

All last checked 22 Nov 2026.

Frequently asked questions

What is the best free IP geolocation API for a commercial SaaS?

For country-level data, IPinfo Lite: it is free with no request cap and its data is licensed CC BY-SA 4.0, which allows commercial use with attribution. If you need city-level data for free, ipapi.is allows 1,000 full lookups a day and says the free tier may be used for any purpose, including commercial products. ipgeolocation.io also allows production and commercial use on its free Developer plan of 1,000 credits a day.

Can I use ip-api.com in a commercial product?

Not on the free endpoint. ip-api.com's legal page says use of the free API is strictly limited to a non-commercial purpose and environment, and only Pro members can use it commercially. Pro is listed at 13.3 euros a month when paying for 12 months, excluding VAT, and includes SSL and unlimited requests.

Do I need an API if my app is on Vercel or Cloudflare?

Often not. Vercel sends x-vercel-ip-country, region, city, latitude, longitude, timezone and postal code headers to every deployment. Cloudflare adds CF-IPCountry to requests to your origin on all plans including Free, and its Add visitor location headers Managed Transform adds city, continent, latitude and longitude. For PPP pricing or currency display, the country header is usually enough.

How accurate is IP geolocation?

Country is reliable enough for pricing and display. City is approximate. MaxMind's own accuracy table reports 62% of US IPs and 70% of UK IPs correctly located within 50 km, and for Hong Kong 71% of IPs had no city-level data. VPNs and corporate proxies also put users in the wrong country.

Is an IP address personal data under GDPR?

It can be. The UK ICO lists internet protocol (IP) addresses as an example of an online identifier, and the UK GDPR definition of personal data includes online identifiers. Look up the country, store only what you need, and mention the processing in your privacy policy.