Migration

Migrating from ip-api.com

ip-api.com built a following on a genuinely simple response format: a flat JSON object per lookup with fields like country, regionName, city, lat, lon, isp, and query holding the IP address that was looked up, with no nesting to speak of. That flatness made it a common first choice for anyone adding basic IP geolocation to a project without wanting to learn a more elaborate schema.

IP geolocation is one of the lookups where results can actually be shown working end to end, unlike geocoding or autocomplete where only the shape is described. A request against an IPv4 or IPv6 address returns country, region, city, coordinates, and network information drawn from data that stays current through our own caching pipeline, rather than a static or slowly refreshed dataset.

My Geocode's ip-api compatibility host reproduces the flat field structure exactly, including country, regionName, city, lat, lon, isp, and query, with the copyright, terms, and privacy text as the only difference in content. Reference details are at /compatibility/ip-api/. Code that reads response.city or response.isp directly, without unwrapping any nested object, should keep working once the host and key change.

What specifically changes in this migration:

  • Authentication moves to a key, sent as an X-API-Key header, Authorization: Bearer, HTTP Basic auth, or a query parameter, rather than an unauthenticated or lightly-limited public lookup
  • Quota is now visible directly on every response through headers like X-Quota-Limit, X-Quota-Used, and X-Quota-Reset, rather than needing to be inferred from occasional throttling
  • Optional extra fields, IP threat detail and deeper network information, are available by adding mg_extras=1 or an X-MG-Extras header, without altering the flat shape your code already parses

There are 2,500 free requests a day with no key at all, and every key also gets 2,500 free requests a day counted per network, whether IPv4 (per /24) or IPv6 (per /48), shared between keyless and keyed use from that network. Beyond that allowance, it is prepaid credit at €0.0001 per request or an Unlimited key at €50 a month, and every endpoint, including this compatibility host, is priced the same.

For applications doing IP-based country redirects, fraud signal checks, or basic analytics enrichment, this is usually one of the simpler migrations to test end to end, since the results are concrete and comparable directly against what the current integration returns for the same set of test addresses.