IPv4 Lookup API
Country, region, city, approximate coordinates, timezone, the network and the operator behind it, datacentre and proxy flags, and a threat block that says whether the address has been reported for abuse or attacks, and how badly. Leave the ip parameter out and you get the caller's own address, which is the common case for websites.
Example
$ curl -H "X-API-Key: YOUR_KEY" "https://api.mygeocode.com/v1/ipv4?ip=8.8.8.8"
# The caller's own address
$ curl -H "X-API-Key: YOUR_KEY" "https://api.mygeocode.com/v1/ipv4"City-level geolocation of an IP address is an estimate and always will be; the address belongs to a network, not a person. Country is right for well over 99% of addresses. City is most reliable for consumer ISPs and least reliable for mobile carriers and datacentres, which is why those are flagged.
{
"status": "ok",
"ip": "8.8.8.8",
"version": 4,
"found": true,
"prefix": "8.8.8.0/24",
"country": "United States",
"country_code": "US",
"continent": "North America",
"continent_code": "NA",
"region": "California",
"region_code": "CA",
"city": "Mountain View",
"postcode": "94043",
"lat": 37.386051,
"lon": -122.083849,
"timezone": "America/Los_Angeles",
"utc_offset": "-07:00",
"utc_offset_seconds": -25200,
"is_eu": false,
"asn": 15169,
"as_name": "Google LLC",
"org": "Google LLC",
"usage_type": "Content",
"registry": "arin",
"allocated": "2000-03-30",
"tags": ["a10k", "anycast", "cdn", "icrit", "vpn", "vpsh"],
"is_anycast": true,
"is_satellite": false,
"is_datacenter": true,
"is_proxy": false,
"is_vpn_provider": true,
"is_tor": false,
"crawler": null,
"is_private": false,
"abuse_email": "network-abuse@google.com",
"threat": {
"listed": false,
"score": 0,
"source_count": 0,
"categories": [],
"is_tor": false,
"is_tor_exit": false,
"is_bogon": false,
"listings": []
},
"updated_at": "2026-09-18 06:52:52"
}What you get back
| Field | Meaning |
|---|---|
country, country_code | Country name and ISO 3166-1 alpha-2 code. |
region, region_code | State, province or equivalent, with its ISO 3166-2 code where one exists. |
city, postcode | Best estimate of the city and postal code. null when unknown. |
lat, lon | Coordinates of the city or, failing that, the region or country centre. |
elevation_m | Ground height at those coordinates in metres, from the elevation data. Only with elevation=1. |
timezone | IANA name, from the location. |
asn, org | The autonomous system number and the organisation that announces the prefix. |
is_datacenter | The address is in a hosting or cloud range. Treat city as unreliable and consider that the traffic may be automated. |
is_proxy, is_tor, is_vpn_provider | Per-address evidence of a Tor relay or proxy listing; and, separately, whether the operator sells VPN services at all. |
crawler | When the address is in a range a crawler operator publishes (Googlebot, Bingbot, GPTBot and others): its name and type. Otherwise null. |
usage_type, tags, registry, allocated, abuse_email | What kind of operator runs the network, its operator tags, which registry allocated it and when, and its abuse contact. |
threat | Reputation block: listed or not, a 0 to 100 score, how many independent reports list the address and in which categories, Tor and bogon flags, and each listing with its confidence and age. Refreshed daily. |
Where it is used
Localising a first visit
Pick a default country, currency, language and units before the visitor has typed anything. Pass the visitor's address as ip from your server.
Fraud and abuse signals
Compare the IP country with the billing country. Treat is_proxy and is_datacenter as signals, not verdicts.
Analytics without cookies
Aggregate visits by country and region server-side from access logs, with no client-side tracking at all.
Price and limits
One call is one request; each address in a batch counts as one. Every account has 2,500 free requests a day, shared by all of its keys; past that, €0.0001 each from prepaid credit, or nothing on an Unlimited key (€50 a month). Pricing. Migrating from ip-api, ipinfo or ipstack? Those formats are available as drop-in hosts. For IPv6 addresses see the IPv6 Lookup API.