ip-api.com API
Free IP geolocation API returning country, city, coordinates, timezone and ISP for any IP. No key on the free tier, 45 requests per minute. Tested curl example.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the ip-api.com API?
ip-api.com is a free IP geolocation API that returns country, region, city, latitude, longitude, timezone, ISP and organisation for any IP address. The free tier needs no API key but is limited to 45 requests per minute and HTTP only.
ip-api.com is the most generous no-signup IP geolocation service still operating, returning a genuinely detailed record — down to ISP, autonomous system and timezone — from a single unauthenticated request.
There is one important constraint that catches people out: the free endpoint is HTTP only. HTTPS requires a paid plan, which means you cannot call the free tier directly from a browser on an HTTPS page without triggering mixed-content blocking. Call it server-side instead.
Quick facts
- Base URL
http://ip-api.com/json- Authentication
- No key on the free tier. Free use is limited to non-commercial purposes; commercial use requires a paid plan.
- Rate limit
- 45 requests per minute per IP. Exceeding it returns HTTP 429 and can trigger a temporary ban.
- Pricing
- Free for non-commercial use over HTTP. Paid plans add HTTPS, higher limits and commercial rights.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the ip-api.com API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Geolocate Google's public DNS server
GET http://ip-api.com/json/8.8.8.8
curl 'http://ip-api.com/json/8.8.8.8'const res = await fetch("http://ip-api.com/json/8.8.8.8");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("http://ip-api.com/json/8.8.8.8", timeout=20)
res.raise_for_status()
print(res.json()){
"status": "success",
"country": "United States",
"countryCode": "US",
"region": "VA",
"regionName": "Virginia",
"city": "Ashburn",
"zip": "20149",
"lat": 39.03,
"lon": -77.5,
"timezone": "America/New_York",
"isp": "Google LLC",
"org": "Google Public DNS",
"as": "AS15169 Google LLC",
"query": "8.8.8.8"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<ip> | path | Optional | IP or domain to look up. Omit to geolocate the caller. 8.8.8.8 |
fields | string | Optional | Comma-separated field list or a numeric bitmask, to shrink the response. status,country,city,isp |
lang | string | Optional | Response language for country and region names. en |
Response fields
statusstring- `success` or `fail`. Always check this first — failures still return HTTP 200.
country / countryCodestring- Country name and ISO alpha-2 code.
regionName / city / zipstring- Administrative region, city and postal code, all approximate.
lat / lonfloat- Approximate coordinates — city-level centroid, not a precise position.
timezonestring- IANA timezone identifier.
isp / org / asstring- Internet service provider, organisation and autonomous system.
What you can build with the ip-api.com API
- Redirect visitors to a country-specific site version or currency
- Flag logins from unexpected countries for fraud review
- Pre-fill a country field in checkout or signup forms
- Enrich server logs and analytics with approximate geography
Common errors and how to fix them
status: fail
Reserved, private or invalid IP address. Returned with HTTP 200, not an error code.
Fix: Check `status` before reading other fields; read the `message` field for the reason.
429
More than 45 requests in a minute.
Fix: Throttle client-side and cache per IP — geolocation for an address rarely changes.
Mixed content blocked
You called the HTTP endpoint from an HTTPS page.
Fix: Call it from your server, not the browser. HTTPS needs a paid plan.
ip-api.com API — frequently asked questions
Is ip-api.com free to use?
It is free for non-commercial use with no API key, limited to 45 requests per minute over HTTP. Commercial use, HTTPS and higher limits require a paid plan.
Why does ip-api.com return HTTP 200 when the lookup failed?
It signals failure in the JSON body rather than the status code. Always check that `status` equals `success` before reading any other field.
How accurate is IP geolocation?
Country accuracy is typically above 95%, but city accuracy is far lower and the coordinates are a regional centroid, not a real location. VPNs, mobile carriers and corporate proxies all break it. Never use it for anything requiring real precision.
Can I use ip-api.com from browser JavaScript?
Only over HTTP, which browsers block on HTTPS pages as mixed content. In practice you should call it from your backend and pass the result to the client.
Tools that pair with this API
ip-api.com is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.