ip-api.com drop-in replacement
ip-api's JSON endpoint is one of the most widely copied IP lookup formats. ipapi.mygeocode.com returns the same field names for IPv4 and IPv6 addresses, over HTTPS on the free tier, which ip-api does not offer.
Change one hostname
| Original host |
|
|---|---|
| Use instead | ipapi.mygeocode.com |
| Key parameter | key (put your My Geocode key here, or leave it out for the free 2,500 a day) |
curl "http://ip-api.com/json/8.8.8.8?fields=status,country,countryCode,city,lat,lon,timezone,isp,query"curl "https://ipapi.mygeocode.com/json/8.8.8.8?fields=status,country,countryCode,city,lat,lon,timezone,isp,query"Why people move
ip-api's free endpoint is HTTP only, non-commercial, and limited to 45 requests a minute. Here it is HTTPS, commercial use is fine, and you get 2,500 a day before paying anything.
Try it before you sign up for anything. Requests to ipapi.mygeocode.com count toward the same 2,500 a day you get on our own endpoints, with no key and no account. Above that, credits at $0.001 per request or €50 a month unlimited. Signing up takes an email address and nothing else.
Endpoints
| Path on ipapi.mygeocode.com | What it does | Backed by |
|---|---|---|
/json/{ip} | Lookup by address, IPv4 or IPv6 | IPv4 lookup |
/json/ | Lookup the caller | IPv4 lookup |
/batch (POST, JSON array) | Batch lookup, up to 100 | IPv4 lookup |
Example response
This is what the request above returns. Field names, nesting and types follow ip-api. Only the data behind them is ours.
{
"status": "success",
"country": "United States",
"countryCode": "US",
"region": "CA",
"regionName": "California",
"city": "Mountain View",
"zip": "94043",
"lat": 37.4056,
"lon": -122.0775,
"timezone": "America/Los_Angeles",
"isp": "Google LLC",
"org": "Google Public DNS",
"as": "AS15169 Google LLC",
"query": "8.8.8.8"
}Details and differences
- The fields and lang parameters are honoured, including the numeric fields bitmask.
- Failures return status: fail with a message, as ip-api does.
- Batch requests count one request per address.
If your client depends on a field or behaviour that is not listed here, tell us. Compatibility gaps get fixed quickly because they are usually small.