ip-api API

⭐ Beginner's Pick Geocoding / No Auth Required Beginner HTTP
Free to Use Varies (check documentation)

Overview

ip-api provides fast, free IP geolocation data including country, city, region, ISP, and coordinates for any public IP or domain name. It requires no API key for basic usage and supports both JSON and XML responses. The free tier is limited to 45 requests per minute from non-commercial use.

💡

Beginner Tip

You can look up your own IP by calling http://ip-api.com/json (no IP needed) — great for testing. Note that ip-api requires HTTP (not HTTPS) on the free tier; HTTPS is only available on paid plans.

Available Data

IP address information
geographic location
ASN and ISP data

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from ip-api",
    "description": "Find location with IP address or domain",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

status "success" if the lookup worked, "fail" if the IP was invalid or private.
country Full country name for the IP address.
countryCode ISO 3166-1 alpha-2 two-letter country code.
city Estimated city name for the IP location.
isp Internet Service Provider name for the IP.
lat Approximate latitude of the IP location.
lon Approximate longitude of the IP location.

Implementation Example

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://ip-api.com/docs";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

fail status with "private range" message You passed a private or reserved IP address like 192.168.1.1.
Use a public IP address. Omit the IP entirely to auto-detect the caller's IP.
429 / rate limit exceeded More than 45 requests per minute from the same IP.
Add a delay between requests or purchase a pro plan for higher limits.
SSL/HTTPS error The free tier does not support HTTPS.
Use http:// instead of https:// for free-tier requests, or subscribe to the pro plan for HTTPS access.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 5/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 315ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS NO
CORS UNKNOWN
Category Geocoding
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →