v2

latestOpenAPI 3.1.0Proprietary2026-08-01122398.8 KB
IP

Look up an IP address (path slug)

Returns the geolocation record for the IP address given as the path slug: location (continent, country, subdivision, city, coordinates, postal), connection (ASN, organization, domain), security signals, and timezone. Both IPv4 and IPv6 are accepted; a value that isn't a valid IP address returns HTTP 400 before any lookup, and a valid but unlocatable address (private/reserved) returns HTTP 400 with the reason in the message. Every response carries the full canonical key tree; a leaf that can't be resolved for an address ships as null. See https://restcountries.com/docs/ip for the full reference.

get/ip/v1/{ip}

Path parameters

ipstring required

IP address to look up. Both IPv4 and IPv6 are accepted. A value that isn't a valid IP address returns HTTP 400 before any lookup is attempted.

Query parameters

response_fieldsstring

Comma-separated dot-path projection. Only the specified fields are returned. Example: names.common,codes.alpha_2,flag.emoji

response_fields_omitstring

Comma-separated dot-path blocklist. The specified fields are removed from the response. Useful for trimming heavy branches like names.translations.

prettyboolean

Set to true (a bare ?pretty, 1, or true) to pretty-print the JSON response; 0 or false keep it minified. Default is minified.

Response

Geolocation record for the resolved IP address, always a single object.