DEV Community

Vix
Vix

Posted on

ip-api.com vs ipify vs IPPubblico — which free IP API should you use in 2026?

ip-api.com vs ipify vs IPPubblico — which free IP API should you use in 2026?

If you need a public IP detection or geolocation API for your project, three names come up repeatedly: ip-api.com, ipify, and IPPubblico. They are all free, they all work without much setup, and they all solve roughly the same problem — but in meaningfully different ways.

This article breaks down the real differences so you can pick the right tool for your use case.


Quick comparison

Feature ip-api.com ipify IPPubblico
API key required No (free tier) No No
HTTPS (free tier) ❌ HTTP only
CORS (free tier)
Rate limit (free) 45 req/min None stated No hard limit*
Commercial use (free)
Plain text endpoint
IPv4 detection
IPv6 detection
Geolocation (city, region)
ISP / ASN
Timezone
Interface languages 1 (English) 1 (English) 43
Local MaxMind DB
Open source / self-hostable

*Soft limiting applies for abuse prevention.

ip-api.com

ip-api has been around since 2012 and is one of the most referenced IP geolocation APIs in developer tutorials. It returns a rich JSON response with country, city, ISP, ASN, timezone, and more — all without requiring a key.

The catch: the free tier only works over HTTP, not HTTPS. This is a significant limitation for any frontend application, where mixed content policies will block the request outright in modern browsers. HTTPS is available on the paid Pro plan only.

CORS is also disabled on the free tier, making it unusable for direct browser calls without a proxy.

Rate limit: 45 requests per minute per IP. For most use cases this is fine, but it means a single active user hitting the API repeatedly will be throttled quickly.

Commercial use: explicitly prohibited on the free tier.

// HTTP only on free tier — will be blocked by browsers on HTTPS pages
fetch('http://ip-api.com/json')
  .then(res => res.json())
  .then(data => {
    console.log(data.country);    // "Italy"
    console.log(data.city);       // "Milan"
    console.log(data.isp);        // "Telecom Italia"
    console.log(data.timezone);   // "Europe/Rome"
  });
Enter fullscreen mode Exit fullscreen mode
import requests

# works fine server-side where HTTPS is not required
response = requests.get('http://ip-api.com/json')
data = response.json()
print(data['country'])   # Italy
print(data['city'])      # Milan
print(data['isp'])       # Telecom Italia
Enter fullscreen mode Exit fullscreen mode

Best for: server-side scripts and backend applications where HTTPS and CORS are not a concern, and commercial use is not required.


ipify

ipify does one thing and does it well: it returns your public IP address. Nothing more.

The API is extremely simple — a single endpoint, three response formats (plain text, JSON, JSONP), HTTPS enabled, CORS enabled, no key required. It has been running reliably for years and is widely used in scripts, CI/CD pipelines, and network tooling.

The limitation: ipify provides no geolocation data. You get the IP and nothing else. If you need country, city, or ISP, you need a second API call to a different service.

Rate limit: not officially stated. The service is designed for high volume and handles a very large number of requests globally, but there is no documented guarantee.

// plain text — simplest possible
fetch('https://api.ipify.org')
  .then(res => res.text())
  .then(ip => console.log(ip)); // "203.0.113.42"

// JSON format
fetch('https://api.ipify.org?format=json')
  .then(res => res.json())
  .then(data => console.log(data.ip)); // "203.0.113.42"

// IPv6
fetch('https://api6.ipify.org?format=json')
  .then(res => res.json())
  .then(data => console.log(data.ip));
Enter fullscreen mode Exit fullscreen mode
import requests

ip = requests.get('https://api.ipify.org').text
print(ip)  # 203.0.113.42

# or JSON
data = requests.get('https://api.ipify.org?format=json').json()
print(data['ip'])
Enter fullscreen mode Exit fullscreen mode
# shell — very common in scripts
curl https://api.ipify.org
# 203.0.113.42
Enter fullscreen mode Exit fullscreen mode

Best for: getting the public IP address quickly in scripts, backend code, and CLI tools where geolocation is not needed.


IPPubblico

IPPubblico covers both use cases above in a single service: it has a plain text endpoint for simple IP detection and a full JSON endpoint for geolocation, both over HTTPS and with CORS enabled — all without an API key.

A few things distinguish it technically from the other two:

Local MaxMind database. Geolocation lookups are served from a local copy of the MaxMind GeoLite2 database, not from a third-party API chain. This means lower latency for the lookup and no dependency on upstream services.

Dedicated subdomains for protocol detection. ipv4.ippubblico.org forces an IPv4 connection and returns only the IPv4 address. ipv6.ippubblico.org does the same for IPv6. This is useful when you need to explicitly detect one protocol regardless of the client's default.

43 interface languages. The web interface and documentation are available in 43 languages, which is useful for projects targeting non-English-speaking markets.

Rate limit: No hard rate limit. Soft limiting applies for abuse
prevention on all endpoints, with a Retry-After header on 429
responses to guide clients on when to retry.

Commercial use: allowed on the free tier.

// plain text IPv4 — fastest option
fetch('https://ipv4.ippubblico.org/')
  .then(res => res.text())
  .then(ip => console.log(ip.trim())); // "203.0.113.42"

// IPv4 + IPv6 together
fetch('https://ippubblico.org/?text=1')
  .then(res => res.text())
  .then(text => {
    const lines = text.trim().split('\n');
    // "IPv4: 203.0.113.42"
    // "IPv6: NONE"
    console.log(lines[0]);
    console.log(lines[1]);
  });

// full geolocation
fetch('https://ippubblico.org/?api=1')
  .then(res => res.json())
  .then(data => {
    console.log(data.ip);              // "203.0.113.42"
    console.log(data.geo.country);     // "Italy"
    console.log(data.geo.city);        // "Milan"
    console.log(data.isp);             // "Telecom Italia"
    console.log(data.timezone);        // "Europe/Rome"
  });
Enter fullscreen mode Exit fullscreen mode
import requests

# plain text
ip = requests.get('https://ipv4.ippubblico.org/').text.strip()
print(ip)  # 203.0.113.42

# full geolocation
data = requests.get('https://ippubblico.org/?api=1').json()
print(data['geo']['country'])   # Italy
print(data['geo']['city'])      # Milan
print(data['isp'])              # Telecom Italia
print(data['timezone'])         # Europe/Rome
Enter fullscreen mode Exit fullscreen mode
# plain text
curl https://ipv4.ippubblico.org/
# 203.0.113.42

# full JSON
curl https://ippubblico.org/?api=1
Enter fullscreen mode Exit fullscreen mode

Handling the rate limit on plain text endpoints:

async function getIP() {
  const res = await fetch('https://ipv4.ippubblico.org/');

  if (res.status === 429) {
    const wait = parseInt(res.headers.get('Retry-After') ?? '20', 10);
    await new Promise(resolve => setTimeout(resolve, wait * 1000));
    return getIP();
  }

  return res.text().then(t => t.trim());
}
Enter fullscreen mode Exit fullscreen mode

Best for: frontend applications that need HTTPS and CORS, projects requiring both IP detection and geolocation in a single call, and use cases where commercial use on the free tier matters.


Which one to choose

Use ip-api.com if:

  • You are on the backend only (Node.js, Python, PHP server-side)
  • You need rich geolocation data
  • You will not use it commercially
  • You are comfortable with the HTTP-only limitation

Use ipify if:

  • You only need the IP address, no geolocation
  • You need maximum simplicity
  • You are writing shell scripts or CLI tools
  • You need very high volume without documented rate limits

Use IPPubblico if:

  • You are calling the API from the browser (requires HTTPS + CORS)
  • You need both IP detection and geolocation in one call
  • You need commercial use on the free tier
  • You want dedicated IPv4/IPv6 subdomains
  • You want a Retry-After header for clean error handling

Summary

None of these three services is universally better — they optimize for different constraints. ip-api.com has the richest data but breaks in browser environments on the free tier. ipify is the most reliable for the single job of IP detection but does nothing else. IPPubblico covers both cases with HTTPS and CORS included, at the cost of a rate limit on the plain text endpoints.

For most frontend projects in 2026, the HTTPS requirement alone rules out ip-api.com's free tier. Between ipify and IPPubblico, the choice comes down to whether you need geolocation or just the IP.

Full IPPubblico documentation: ippubblico.org/docs.html

Top comments (0)