Skip to contentAPILayer: production APIs with free plansExplore APILayer
๐•inr/
Cover illustration: Free IP Geolocation APIs Compared: ipstack vs ipapi vs ip-api vs IPinfo (2026)
Favour Onuoha

Posted on ยท 4 min read

Free IP Geolocation APIs Compared: ipstack vs ipapi vs ip-api vs IPinfo (2026)

On this page ยท 10 sections

Quick answer: for unlimited free country-level lookups, use IPinfo Lite. For city-level data on a free tier, ipapi.co gives you up to 1,000 lookups a day over HTTPS, and ipstack gives you 100 a month with a clean commercial upgrade path. ip-api.com is the most generous for hobby projects (45 requests a minute), but its free endpoint is HTTP-only and non-commercial.

IP geolocation turns an IP address into a location: country, region, city, time zone, and often the network owner. Developers use it to localise content, pre-fill country fields, flag suspicious logins and route traffic. Our directory tracks 111 geocoding and location APIs, 101 of which were online in our October 24, 2026 check. These are the IP lookup services developers compare most often.

#Free tier comparison (October 2026)

API

Free allowance

HTTPS on free

Commercial use on free

Detail level

Key

ipstack

100/month

Yes

Yes

City, region, time zone, connection

Yes

IPinfo Lite

Unlimited

Yes

Yes, with attribution

Country, continent, ASN

Free token

ipapi.co

Up to 1,000/day (~30,000/month)

Yes

Check terms

City, region, postal, time zone, currency

No (for the free tier)

ip-api

45 requests/minute

No (HTTP only)

No

City, region, ISP, time zone

No

ipapi.com

Limited free plan

Check plan

Yes

City-level

Yes

Paid upgrades, from the providers' pricing pages: ipstack Basic is $12.99/month for 50,000 requests. ipapi.co starts at $15/month for 60,000 lookups. ip-api.com Pro adds HTTPS, unlimited queries and commercial use.

#We looked up the same IP on every service

To show why accuracy claims deserve scepticism, we looked up 8.8.8.8 (Google's public DNS) on two free APIs in October 2026:

  • ipapi.co: Mountain View, California
  • ip-api.com: Ashburn, Virginia

Both are defensible. Google is headquartered in Mountain View, but 8.8.8.8 is anycast and served from data centres everywhere. The lesson: city-level IP data is an estimate. Country-level data is reliable for most residential and mobile IPs; city-level is often wrong by tens of kilometres, and VPN or cloud IPs can point anywhere. Use IP location to suggest a default, never to make a decision you can't override.

#ipstack: small free tier, clean upgrade path

ipstack, from APILayer, has one of the longest track records. Its free plan is small at 100 requests a month, but includes SSL. Paid plans scale from 50,000 to 2 million requests and add security modules (proxy, crawler and Tor detection).

JavaScript
const res = await fetch(
  `https://api.ipstack.com/134.201.250.155?access_key=${process.env.IPSTACK_KEY}`
);
const data = await res.json();
if (data.success === false) throw new Error(data.error.info);
console.log(data.city, data.region_name, data.country_name);

Note that ipstack reports errors in the JSON body (success: false) with an error code, so check for that as well as the HTTP status.

#IPinfo Lite: unlimited, country-level

IPinfo launched IPinfo Lite in 2025: unlimited requests for country and ASN (network owner) data, free with a token and attribution. It's the obvious choice for "which country is this visitor in?"

Bash
curl "https://api.ipinfo.io/lite/8.8.8.8?token=$IPINFO_TOKEN"

City, privacy (VPN/proxy) and carrier detection need a paid plan. IPinfo also publishes the Lite data as a free downloadable database (CSV, JSON, MMDB), so you can look IPs up locally with no API call at all.

#ipapi.co: the best free city-level option

ipapi.co returns city, region, postal code, coordinates, time zone, currency and calling code, with no key on the free tier. The free tier allows up to 1,000 lookups a day (about 30,000 a month), although the provider notes it may throttle free usage further.

Python
import requests

def locate(ip: str) -> dict:
    res = requests.get(
        f"https://ipapi.co/{ip}/json/",
        headers={"User-Agent": "my-app/1.0"},   # requests without a User-Agent were rejected in our test
        timeout=10,
    )
    res.raise_for_status()
    d = res.json()
    return {k: d.get(k) for k in ("city", "region", "country_name", "timezone", "currency")}

print(locate("8.8.8.8"))

Call https://ipapi.co/json/ (no IP) to look up the caller's own address, which is handy from a browser.

#ip-api.com: generous, but HTTP and non-commercial

ip-api allows 45 requests a minute with no key, and lets you choose exactly which fields to return:

Bash
curl "http://ip-api.com/json/8.8.8.8?fields=status,country,countryCode,city,lat,lon,timezone,isp,query"

Two important restrictions on the free endpoint: it's HTTP only (SSL is a Pro feature), so browsers on HTTPS sites will block it as mixed content. And it's strictly non-commercial; its terms specifically list shop localisation, ad targeting and fraud prevention as commercial uses. Exceed the rate limit repeatedly and your IP can be banned for up to an hour.

#Doing it in the browser

To show a visitor's own country on a static site, call an HTTPS API that supports looking up the caller's IP:

JavaScript
const res = await fetch("https://ipapi.co/json/");
const { country_name, city } = await res.json();
document.querySelector("#location").textContent = `${city}, ${country_name}`;

For anything beyond a hobby page, do the lookup on your server (or at the edge: Vercel, Cloudflare and Netlify expose the visitor's country in request headers for free), so the key and rate limits stay under your control.

#Which IP geolocation API should you use?

  • Country only, unlimited: IPinfo Lite, or your hosting provider's geo headers.
  • City-level, free, HTTPS: ipapi.co.
  • Commercial product that will grow: ipstack or IPinfo paid plans, which include VPN and proxy detection.
  • Hobby project or script: ip-api.com, server-side only.
  • No API at all: download a free database (IPinfo Lite, or DB-IP's free country database) and look up locally.

Compare more options on our geocoding API rankings, which are re-ranked daily by uptime and response time.

#Privacy note

An IP address is personal data under GDPR in many contexts. Don't store raw IPs longer than you need, mention geolocation in your privacy policy, and prefer country-level lookups when that's all the feature requires.

#FAQ

#What is the best free IP geolocation API?

IPinfo Lite for unlimited country-level lookups; ipapi.co for city-level data, with up to 1,000 free lookups a day over HTTPS.

#Is ip-api.com free for commercial use?

No. The free endpoint is strictly non-commercial and HTTP-only. Commercial use requires ip-api Pro.

#How accurate is IP geolocation?

Country-level is accurate for most residential and mobile IPs. City-level is an estimate and can be off by tens of kilometres, or completely wrong for VPN, mobile carrier and cloud IPs.

#Can I get a visitor's location without an API?

Yes. Hosting platforms like Vercel and Cloudflare add the visitor's country (and often city) to request headers, and free downloadable databases let you look up IPs locally.