Skip to main content

Get Country by IP Address

This request returns the country associated with an IP address.

get /countries/{ip_address}

Sample

A sample GET request to get a country associated with an IP address:

curl -X GET \
'https://api.carrierx.com/core/v2/countries/ip/2.6.26.2' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the Country object:

{
"city": "Bordeaux",
"common_name": "France",
"iso_3166_alpha_2": "FR",
"region": "Nouvelle-Aquitaine",
"state": null
}
tip

Contact technical support at support@carrierx.com to enable searching for countries by IP address.

Required Scopes

To get information about a Country object, the partner must have one of the following scopes enabled:

  • countries.manage & lookup.ip_addresses.read
  • countries.read & lookup.ip_addresses.read

Path Arguments

ParameterData TypeDescription
ip_address requiredstringThe IPv4 address.