IPv4 lookup

Location, timezone and network details for an IPv4 address. Leave the address out to look up the caller.

GEThttps://api.mygeocode.com/v1/ipv4

Parameters

ParameterTypeDescription
ipoptionalstringDotted IPv4 address. Default: the address the request came from.
ipsoptionalstringComma-separated addresses, up to 100, for a batch. Returns results array in the same order. Each address counts as one request.
elevationoptionalflag1 adds elevation_m, the ground height at the coordinates.
keyoptionalstringAPI key, if not sent as a header.

Example

$ curl -H "X-API-Key: YOUR_KEY" "https://api.mygeocode.com/v1/ipv4?ip=1.1.1.1"
// In a browser, with no ip parameter, this returns the visitor's own address
const geo = await (await fetch("https://api.mygeocode.com/v1/ipv4", { headers: { "X-API-Key": "YOUR_KEY" } })).json();
console.log(geo.country_code, geo.timezone);
import requests

geo = requests.get("https://api.mygeocode.com/v1/ipv4", params={"ip": "1.1.1.1"}, headers={"X-API-Key": "YOUR_KEY"}, timeout=5).json()
print(geo["country_code"], geo["org"], geo["is_datacenter"])
Response
{
  "status": "ok",
  "ip": "1.1.1.1",
  "version": 4,
  "found": true,
  "prefix": "1.1.1.0/24",
  "country": "Australia",
  "country_code": "AU",
  "continent": "Oceania",
  "continent_code": "OC",
  "region": "Queensland",
  "region_code": "QLD",
  "city": "Brisbane",
  "postcode": "4000",
  "lat": -27.467542,
  "lon": 153.028089,
  "timezone": "Australia/Brisbane",
  "utc_offset": "+10:00",
  "utc_offset_seconds": 36000,
  "is_eu": false,
  "asn": 13335,
  "as_name": "Cloudflare, Inc.",
  "org": "Cloudflare, Inc.",
  "usage_type": "Content",
  "registry": "arin",
  "allocated": "2010-07-14",
  "tags": ["a10k", "anycast", "cdn", "ddosm", "icrit", "rpkirov", "vpn"],
  "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": "abuse@cloudflare.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"
}

Response fields

FieldTypeDescription
ip, versionstring, integerThe address looked up, in canonical form, and 4 or 6.
foundbooleanFalse when no network covers the address; location fields are then null.
prefixstringThe most specific network containing the address, in CIDR form.
country, country_codestringCountry name and upper-case ISO 3166-1 alpha-2 code.
continent, continent_codestringContinent name and two-letter code.
region, region_codestringFirst-level division and its short code. The code is filled in for the United States, Canada and Australia; elsewhere it is present only where the dataset carries one.
city, postcodestringBest estimate; null when unknown.
lat, lonnumberCentre of the most specific known area.
elevation_mnumber or nullHeight above mean sea level at that point in metres, from the same 15 arc-second grid as the elevation endpoint. Negative over the sea floor. Only with elevation=1.
timezone, utc_offset, utc_offset_secondsstring, string, numberIANA zone, the offset in force right now as +HH:MM, and the same offset in seconds. The zone is decided by the coordinates and the time zone boundaries, so it always agrees with lat and lon.
is_eubooleanThe country is in the European Union.
asn, as_name, orginteger, stringAutonomous system number, its name, and the organisation behind it.
usage_typestringWhat the operator is: Eyeball (consumer ISP), Carrier, Content, Hosting, Enterprise, Education, NSP or unknown.
registry, allocatedstringRegional registry that allocated the ASN and the allocation date.
tagsarrayOperator-level tags such as dsl, cdn, vpsh (VPS hosting), vpn, satnet. They describe the network operator, not the individual address.
is_anycast, is_satellitebooleanThe prefix is anycast; the operator is a satellite network.
is_datacenterbooleanHosting or content network, or an anycast prefix. Treat city as unreliable and consider that the traffic may be automated.
is_proxy, is_torbooleanPer-address evidence that it is a Tor relay or exit, or is listed as a proxy or VPN endpoint.
crawlerobject or nullWhen the address is in a range a crawler operator publishes (Googlebot, Bingbot, Applebot, GPTBot and others): its name and type.
is_vpn_providerbooleanThe operator runs VPN or proxy services somewhere in its network (an operator-level hint, weaker than is_proxy).
is_privatebooleanReserved, private or otherwise non-routable address. When true the response carries only ip, version, is_private and reason.
abuse_emailstringAbuse contact registered for the network.
threatobjectReputation: listed, a score from 0 to 100 (the weight of the worst report, discounted for old ones), source_count (how many independent reports list it), categories, Tor and bogon flags, and the individual listings with category, confidence and how many days ago each was reported.
updated_atstringWhen the record for this network was last refreshed.

Either version in one call

GET /v1/ip accepts an IPv4 or an IPv6 address (or none, for the caller) and returns the same record as the version-specific endpoints. Use it when you do not know in advance which kind of address you will be given.

Notes

The same lookup in other providers' formats

If you already have code written against one of these providers, keep it: the drop-in host accepts the same path and parameters and answers in that provider's response shape, with this endpoint behind it. See how the drop-ins work.

ProviderHostPath
Geoapifygeoapify.mygeocode.com/v1/ipinfo?ip=...
ip-api.comipapi.mygeocode.com/json/{ip}
/json/
/batch (POST, JSON array)
ipinfo.ioipinfo.mygeocode.com/{ip}/json
/{ip}
/json
/{ip}/{field}
ipstackipstack.mygeocode.com/{ip}
/check
/{ip},{ip},{ip}

Errors

400 invalid_request when ip is not a valid IPv4 address, or when an IPv6 address is sent to this endpoint (use /v1/ipv6), or when ips has more than 100 entries. In a batch, an entry that is not a valid IPv4 address does not fail the call: its place in results holds "status": "error" with the address and an error object, and it is not counted.