# Best IP Geolocation API for Indie Developers (2026)

> Best IP geolocation API for small SaaS in 2026: free tiers, commercial-use terms, HTTPS, VPN detection and paid prices for 9 options, plus free Vercel headers.

- Canonical: https://zeroraised.com/blog/best-ip-geolocation-api-for-indie-developers
- Published: 2026-11-23T07:15:00Z
- Author: ZeroRaised Team (https://zeroraised.com/blog/authors/zeroraised)
- Publisher: ZeroRaised (https://zeroraised.com/)
- Section: Building
- Tags: developer-tools, apis, pricing, saas

**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](https://vercel.com/docs/headers/request-headers)). Cloudflare's IP geolocation adds `CF-IPCountry` and is available on Free, Pro, Business and Enterprise ([Cloudflare IP geolocation](https://developers.cloudflare.com/network/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](https://ipinfo.io/lite)).
- **Best free API with city, commercial allowed:** ipapi.is, "1,000 requests per day, every day, with the full response" ([ipapi.is pricing](https://ipapi.is/pricing.html)).
- **Watch the terms:** ip-api.com's free endpoint is non-commercial only ([ip-api legal](https://ip-api.com/docs/legal)), and ipapi.co's free trial "is not meant for use in production" ([ipapi.co pricing](https://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](https://zeroraised.com/blog/purchasing-power-parity-pricing-for-saas) 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](https://zeroraised.com/blog/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

| Option | Free allowance | Commercial use on free | City on free? | HTTPS on free? | VPN/proxy detection | Paid entry price |
|---|---|---|---|---|---|---|
| Vercel headers | Every request on Vercel | Part of hosting | Yes (`x-vercel-ip-city`) | Yes | `x-vercel-waf-source` in Priority projects only | Hosting plan |
| Cloudflare `CF-IPCountry` | Every proxied request | Part of hosting | Via Managed Transform | Yes | Tor flagged as `T1` | Free on all plans |
| IPinfo Lite | No usage cap | Yes, CC BY-SA 4.0 with attribution | No, country and ASN | Not verified today | Not verified today | Not verified today |
| ipapi.is | 1,000 requests a day | "may be used for any purpose, including commercial products" | Full response | Not stated | VPN database $79/mo | $20/mo (20,000/day) |
| ipgeolocation.io | 1,000 credits a day | "Production and commercial use allowed" | Yes | Not stated | "Not available in Free plan" | $19/mo (150K credits) |
| ipdata | 1,000 city lookups a day, then country unlimited, no key | "Commercial use with attribution" | Yes, first 1,000 | Not stated | VPN detection on Business | $50/mo billed yearly |
| IP2Location.io | 50K queries a month | Attribution required; not stated beyond that | Yes | Not stated | Free: open proxies only; VPN on Plus | $49/mo (150K) |
| ipapi.co | Trial up to 1,000/day | "not meant for use in production" | Not stated | Yes | Not mentioned | $15/mo (60K) |
| ip-api.com | 45 requests a minute | No, "strictly limited for a non-commercial purpose" | Yes | SSL listed as a Pro feature | Not covered here | Pro from 13.3 euros/mo (annual) |
| MaxMind GeoLite | Database download, or 1,000 web lookups a day | Needs a "Commercial GeoLite license" for products | Yes (GeoLite City) | Yes | Insights web service only | GeoIP Country $0.0001/query |
| IP2Location LITE | Database download | "free for personal or commercial use with attribution required" | Yes | Download | No | Paid 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](https://vercel.com/docs/headers/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.

```ts
// 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](https://developers.cloudflare.com/network/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](https://developers.cloudflare.com/fundamentals/reference/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](https://ipinfo.io/lite), [Lite API docs](https://ipinfo.io/developers/lite-api)). 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](https://ipapi.is/pricing.html)).

### 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](https://ipgeolocation.io/pricing.html)).

### 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](https://ipdata.co/pricing.html)).

### 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](https://www.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](https://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](https://ip-api.com/docs/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](https://members.ip-api.com/)).

## 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](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/)), and that you can "Incorporate GeoLite data into your products and services with a Commercial GeoLite license" ([GeoLite product page](https://www.maxmind.com/en/geolite-free-ip-geolocation-data)).

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](https://www.maxmind.com/en/geoip-api-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](https://lite.ip2location.com/)). 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](https://www.maxmind.com/en/geoip-accuracy-comparison)).

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](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/personal-information-what-is-it/what-is-personal-data/what-are-identifiers-and-related-factors/)), 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](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/personal-information-what-is-it/what-is-personal-data/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 situation | Our pick |
|---|---|
| PPP pricing, app on Vercel | `x-vercel-ip-country` header, $0 |
| PPP pricing, site behind Cloudflare | `CF-IPCountry`, free on all plans |
| PPP pricing, other host | IPinfo Lite (free, no cap, country) |
| Need city for free in a commercial app | ipapi.is (1,000 a day) or ipgeolocation.io (1,000 credits a day) |
| Signup fraud screening on a budget | IPinfo Lite ASN for hosting networks, then ipapi.is VPN database or MaxMind Insights when abuse costs real money |
| Self-host, no third party sees IPs | IP2Location LITE, or MaxMind GeoLite with a commercial licence |
| High volume, country only | Local database, or MaxMind GeoIP Country at $0.0001 a query |
| Weekend side project, non-commercial | ip-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](https://zeroraised.com/blog/product-launch-checklist-for-bootstrapped-makers), then [launch on ZeroRaised](https://zeroraised.com/submit) for free. For more tool comparisons for founders building without investors, [join the ZeroRaised newsletter](https://zeroraised.com/newsletter).

## Sources

All last checked 22 Nov 2026.

- [Vercel: Request headers](https://vercel.com/docs/headers/request-headers)
- [Cloudflare: IP geolocation](https://developers.cloudflare.com/network/ip-geolocation/)
- [Cloudflare: HTTP headers reference](https://developers.cloudflare.com/fundamentals/reference/http-headers/)
- [IPinfo Lite](https://ipinfo.io/lite) and [IPinfo Lite API docs](https://ipinfo.io/developers/lite-api)
- [ipapi.is pricing](https://ipapi.is/pricing.html)
- [ipgeolocation.io pricing](https://ipgeolocation.io/pricing.html)
- [ipdata pricing](https://ipdata.co/pricing.html)
- [IP2Location.io pricing](https://www.ip2location.io/pricing)
- [ipapi.co pricing](https://ipapi.co/pricing/)
- [ip-api.com legal terms](https://ip-api.com/docs/legal) and [ip-api.com Pro](https://members.ip-api.com/)
- [MaxMind GeoLite developer docs](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/)
- [MaxMind GeoLite product page](https://www.maxmind.com/en/geolite-free-ip-geolocation-data)
- [MaxMind GeoIP web services pricing](https://www.maxmind.com/en/geoip-api-web-services)
- [MaxMind GeoIP accuracy comparison](https://www.maxmind.com/en/geoip-accuracy-comparison)
- [IP2Location LITE](https://lite.ip2location.com/)
- [ICO: What are identifiers and related factors?](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/personal-information-what-is-it/what-is-personal-data/what-are-identifiers-and-related-factors/)
- [ICO: What is personal data?](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/personal-information-what-is-it/what-is-personal-data/what-is-personal-data/)

## 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.


