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 (optional: any address gets 2,500 requests a day with no key; put your My Geocode key here for credit, packages and a usage history) |
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 every account gets 2,500 a day with full fields, and paid usage is per request or flat.
Same free allowance, key or not. Requests to ipinfo.mygeocode.com count toward the same 2,500 free requests a day your address, or your key, gets on our own endpoints. Above that, prepaid credit at €0.0001 per request, or €50 a month for an Unlimited key. Signing up takes a name and an email address, and no card.
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 (ip, hostname, city, region, country, loc, org, postal, timezone) | IPv4 lookup |
/batch (POST, JSON array) | Batch lookup, up to 1,000 | 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.3862,-122.0838",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles",
"anycast": true
}Details and differences
No key is needed for the first 2,500 requests a day. To use a My Geocode key, put it where your ipinfo.io key went: the token query parameter, a Bearer token, or curl -u YOUR_KEY: like ipinfo’s own examples. The X-API-Key header, Authorization: Bearer and HTTP Basic authentication (the key as the user name) work on every host too, so client libraries that authenticate their own way keep working unchanged.
Answers carry the fields ipinfo.io returns and nothing else, so a response can be dropped into code that already parses ipinfo.io. Our additional data (ground elevation, threat and network detail) is available on request: add mg_extras=1 to the query or send X-MG-Extras: 1.
hostnamecomes from a reverse DNS lookup and is left out when the address has no PTR record, exactly as ipinfo does.anycastappears when the address is anycast, and reserved ranges answerbogon.- An address that is not valid answers 404 with ipinfo’s "Wrong ip" body.
- The
readmefield never appears, even on requests without a key. - The single field endpoints (
/8.8.8.8/cityand friends) return plain text. POST /batchworks as ipinfo’s does: a JSON array of up to 1,000 addresses,address/fieldpaths or full URLs answers an object keyed by each entry,filter=1drops the empty ones, and each entry counts as one lookup, as ipinfo counts them. A batch larger than what is left of the day’s allowance is refused whole with ipinfo’s 429 rather than partly answered.
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.