Geolocation Services
Cloud CMS provides geolocation information look up services that can be used to determine geographic information for a given IP address or set of coordinates.
In many places, Cloud CMS automatically utilizes these geolocation services for you. In places where geolocation information is stored on your content instances, geolocation data can automatically be looked up and applied using Cloud CMS features.
In addition, you can invoke the API directly to look up geolocation information for a given IP Address or set of geolocation coordinates.
IP Address
To look up geolocation information for a given IP address, use the following method:
GET /geolocation/resolve/ip?ip={ipAddress}
For example, you might do:
GET /geolocation/resolve/ip?ip=128.253.180.2
And you'll get back an object like this:
{
resolved: true,
info: {
continentCode: "NA",
continentName: "North America",
countryCode: "US",
countryName: "United States",
cityCode: "ithaca",
cityName: "Ithaca",
regionCode: "NY",
regionName: "New York",
postalCode: "14853",
latitude: "42.4485",
longitude: "-76.4804"
},
ok: true
}
If geolocation information can be resolved for a given IP Address, resolved
will be true
. If nothing can be determined for the given IP Address, resolved
will be false
and no info
will be returned.