v1

latestOpenAPI 3.1.02026-07-17417.5 KB

Look up the caller's IP

Resolves the country of the caller's IP address. When behind Cloudflare, the CF-IPCountry header is preferred.

get/

Query parameters

fieldsstring
Example:city,asn

Comma-separated list of extra fields to include. Valid values: city, continent, subdivision, postal, location, asn.

Response

Successful lookup

ipstring required
countrystring nullable required
citystring nullable
continentstring nullable
subdivisionstring nullable
postalstring nullable

Example response

{
  "ip": "8.8.8.8",
  "country": "US",
  "city": "Mountain View",
  "continent": "NA",
  "subdivision": "CA",
  "postal": "94043",
  "location": {
    "latitude": 37.386,
    "longitude": -122.0838,
    "accuracy_radius": 1000,
    "time_zone": "America/Los_Angeles"
  },
  "asn": {
    "number": 15169,
    "organization": "Google LLC"
  }
}
All 4 operations