ipinfo.io drop-in replacement
ipinfo's compact JSON with a loc string and an org string prefixed by the AS number is reproduced at ipinfo.mygeocode.com. The official ipinfo client libraries accept a custom base URL, so they work too.
Change one hostname
| Original host |
|
|---|---|
| Use instead | ipinfo.mygeocode.com |
| Key parameter | token (put your My Geocode key here, or leave it out for the free 2,500 a day) |
curl "https://ipinfo.io/8.8.8.8/json?token=YOUR_IPINFO_TOKEN"curl "https://ipinfo.mygeocode.com/8.8.8.8/json?token=YOUR_MYGEOCODE_KEY"Why people move
ipinfo's free tier is 50,000 a month without geolocation details on some fields. Here the free tier is 2,500 a day with full fields, and paid usage is per request or flat.
Try it before you sign up for anything. Requests to ipinfo.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 ipinfo.mygeocode.com | What it does | Backed by |
|---|---|---|
/{ip}/json | Lookup by address | IPv4 lookup |
/{ip} | Lookup by address (same response) | IPv4 lookup |
/json | Lookup the caller | IPv4 lookup |
/{ip}/{field} | Single field, plain text (city, country, loc, org, timezone) | IPv4 lookup |
Example response
This is what the request above returns. Field names, nesting and types follow ipinfo. Only the data behind them is ours.
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
}Details and differences
- Bearer tokens in the Authorization header are accepted as well as the token query parameter.
- hostname is filled from a reverse DNS lookup when one exists.
- The privacy and company objects from ipinfo's paid plans are not included; is_datacenter and is_proxy from our own IP endpoint are exposed under a mygeocode key instead.
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.
Other drop-in hosts
- Google Maps
- Bing Maps
- HERE
- Mapbox
- Geocode.Farm
- Nominatim (OSM)
- OpenCage
- LocationIQ
- Geoapify
- TomTom
- MapQuest
- Geocodio
- PositionStack
- ip-api
- ipstack
- Open-Elevation
How the drop-ins work, the overview, and the JavaScript library drop-ins.