惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
B
Blog
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
IT之家
IT之家
D
Docker
Google DeepMind News
Google DeepMind News
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
ip-api.com vs ipify vs IPPubblico — which free IP API sho...
Vix · 2026-06-12 · via DEV Community

Vix

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"
  });

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

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));

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'])

# shell — very common in scripts
curl https://api.ipify.org
# 203.0.113.42

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"
  });

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

# plain text
curl https://ipv4.ippubblico.org/
# 203.0.113.42

# full JSON
curl https://ippubblico.org/?api=1

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());
}

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