Skip to main content

IP2Location Object

The IP2Location object contains geographic information derived from an IP address. This data identifies the approximate country, region, state, and city associated with an IP address, which can be used for fraud prevention, localization, or analytics.

IP2Location Object Attributes

The fields listed in the table below will be returned in a JSON object when a successful request has been made.

AttributeData TypeDescription
city
read only
string

The IP address city.

common_name
read only
string

The common name of the country the IP address belongs to.

iso_3166_alpha_2
read only
string

The ISO 3166-1 alpha-2 two-letter code of the country.

iso_3166_alpha_3
read only
string

The ISO 3166-1 alpha-3 three-letter code of the country.

region
read only
string

The IP address region.

state
read only
string

The IP address state.

Sample IP2Location Object

{
"city": "Mountain View",
"common_name": "United States",
"iso_3166_alpha_2": "US",
"iso_3166_alpha_3": "USA",
"region": null,
"state": "CA"
}