Free IP Geolocation APIs
There are several free IP geolocation APIs available. This comparison helps you understand the trade-offs and choose the right one for your project.
Quick Comparison
Section titled “Quick Comparison”| Service | Free Requests | No API Key | Risk Score | Self-Host |
|---|---|---|---|---|
| IPBot | Fair use | Yes | Yes | Yes |
| IP-API.com | 45/min | No (paid) | No | No |
| ipapi.co | 1,000/day | No (paid) | No | No |
| ipwhois.io | 10,000/month | No (paid) | Yes | No |
| ipgeolocation.io | 1,000/month | No (paid) | No | No |
| Cloudflare (-workers) | Unlimited | Yes | No | No |
Detailed Comparison
Section titled “Detailed Comparison”URL: https://api.ipbot.com
Free Tier:
- Fair-use policy (no hard cap)
- No API key required
- Full feature access
Features:
- Geolocation (country, region, city, postal, coordinates, timezone)
- ASN and organization data
- Risk scoring (0-100)
- Proxy/VPN detection
- Datacenter identification
- Tor exit node detection
Response Time: <50ms
Best For: Production applications needing security features without cost
IP-API.com
Section titled “IP-API.com”URL: http://ip-api.com/json/{ip}
Free Tier:
- 45 requests per minute
- 1,000 requests per day (with key)
- HTTP only (no SSL on free tier)
Features:
- Geolocation
- ASN data
- Timezone
- Mobile/carrier detection
- Proxy detection (paid only)
Response Time: ~100ms
Best For: Low-volume, non-critical applications
ipapi.co
Section titled “ipapi.co”URL: https://ipapi.co/{ip}/json/
Free Tier:
- 1,000 requests per day
- 30,000 requests per month
- Rate limited after free tier
Features:
- Geolocation
- ASN data
- Timezone
- Currency data
- User agent parsing
Response Time: ~150ms
Best For: Applications needing currency or extended data
ipwhois.io
Section titled “ipwhois.io”URL: https://ipwhois.app/json/{ip}
Free Tier:
- 10,000 requests per month
- Requires API key
Features:
- Geolocation
- Basic security information
- Currency data
Response Time: ~100ms
Best For: Mid-volume applications with moderate accuracy needs
ipgeolocation.io
Section titled “ipgeolocation.io”URL: https://api.ipgeolocation.io/ipgeo?ip={ip}
Free Tier:
- 1,000 requests per month
- Requires API key
- IP-based rate limiting
Features:
- Geolocation
- Timezone
- Currency
- User agent details
- Android device info
Response Time: ~120ms
Best For: Applications needing timezone or currency data
Cloudflare Workers (1.1.1.1)
Section titled “Cloudflare Workers (1.1.1.1)”URL: https://1.1.1.1/cdn-cgi/trace
Free Tier:
- Unlimited (when using Cloudflare Workers)
Features:
- Basic country code
- No detailed geolocation
- No risk assessment
Response Time: <10ms (Cloudflare edge)
Best For: Cloudflare Workers users needing simple country detection
Feature Matrix
Section titled “Feature Matrix”| Feature | IPBot | IP-API | ipapi.co | ipwhois.io | ipgeolocation |
|---|---|---|---|---|---|
| Country | Yes | Yes | Yes | Yes | Yes |
| Region | Yes | Yes | Yes | Yes | Yes |
| City | Yes | Yes | Yes | Yes | Yes |
| Postal | Yes | Yes | Yes | Yes | Yes |
| Coordinates | Yes | Yes | Yes | Yes | Yes |
| Timezone | Yes | Yes | Yes | Yes | Yes |
| ASN | Yes | Yes | Yes | No | Yes |
| Risk Score | Yes | No | No | Yes | No |
| Proxy Detection | Yes | No | No | Yes | Yes |
| HTTPS | Yes | No | Yes | Yes | Yes |
| No API Key | Yes | No | No | No | No |
Performance Comparison
Section titled “Performance Comparison”Benchmarks from US East region (average of 100 requests):
| Service | P50 Latency | P95 Latency | Success Rate |
|---|---|---|---|
| IPBot | 28ms | 45ms | 99.9% |
| IP-API.com | 95ms | 180ms | 98.5% |
| ipapi.co | 140ms | 250ms | 97% |
| ipwhois.io | 88ms | 160ms | 99% |
| ipgeolocation.io | 110ms | 200ms | 98% |
Accuracy Comparison
Section titled “Accuracy Comparison”Based on testing against known IP locations:
| Service | City Accuracy | Country Accuracy | Notes |
|---|---|---|---|
| IPBot | 85% | 99% | IP2Location DB |
| IP-API.com | 80% | 99% | Proprietary |
| ipapi.co | 82% | 99% | Multiple sources |
| ipwhois.io | 78% | 98% | WHOIS-based |
| ipgeolocation.io | 81% | 99% | Mixed sources |
When to Use Each Service
Section titled “When to Use Each Service”Use IPBot when you:
Section titled “Use IPBot when you:”- Need a production-ready free API
- Want security features (risk scoring, proxy detection)
- Prefer HTTPS without API keys
- Need consistent, reliable responses
- Want the option to self-host
Use IP-API.com when you:
Section titled “Use IP-API.com when you:”- Have very low volume requirements
- Don’t need HTTPS (development/testing)
- Want simple JSON responses
- Can tolerate rate limits
Use ipapi.co when you:
Section titled “Use ipapi.co when you:”- Need currency data alongside geolocation
- Require user agent parsing
- Have moderate monthly volume (
<30k requests)
Use ipwhois.io when you:
Section titled “Use ipwhois.io when you:”- Need basic risk assessment
- Require API key-based authentication
- Have moderate monthly volume (
<10k requests)
Use ipgeolocation.io when you:
Section titled “Use ipgeolocation.io when you:”- Need timezone conversions
- Require Android device detection
- Have low monthly volume (
<1k requests)
Use Cloudflare 1.1.1.1 when you:
Section titled “Use Cloudflare 1.1.1.1 when you:”- Are already using Cloudflare Workers
- Only need country-level detection
- Want absolute lowest latency
- Don’t need detailed location data
Recommendation
Section titled “Recommendation”For most production applications, IPBot offers the best combination of:
- No API key required
- HTTPS support
- Included security features
- High accuracy
- Fast response times
- Option to self-host
The self-hosting option is particularly valuable for applications that need:
- Unlimited requests
- Data privacy (no external API calls)
- Custom rate limiting
- Integration with internal threat intelligence
Code Example: Simple Fallback Pattern
Section titled “Code Example: Simple Fallback Pattern”Here’s a pattern for using multiple free APIs with fallback:
async function getIPInfo(ip) { const services = [ { name: "IPBot", url: `https://api.ipbot.com/${ip}` }, { name: "IP-API", url: `http://ip-api.com/json/${ip}` }, { name: "ipapi.co", url: `https://ipapi.co/${ip}/json/` }, ];
for (const service of services) { try { const response = await fetch(service.url); if (response.ok) { const data = await response.json(); // Normalize response format return normalizeData(data, service.name); } } catch (error) { console.warn(`${service.name} failed, trying next...`); continue; } }
throw new Error("All IP services failed");}This pattern provides resilience by falling back to alternative services if the primary one fails.