We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

Geocoding API

This API exposes the ability to perform searches for geographic addresses in order to retrieve their latitude and longitude coordinates.

This API is backed by the Google Geocoding API. As per the requirements for accessing their service, Google Maps for Work customers must include client and signature parameters with their requests. Hence, Cxense Advertising requires that the Client ID and Client Secret (used to generate signatures for requests) for the account to be used must have been set for your network in Manage -> System Configuration -> Google Maps Integration in order for this API to be enabled.

This API can be accessed by Advertisers and allows an adhoc search address string to be supplied using the HTTP GET method for access.

GET

Perform a search for the given search address and retrieve latitude and longitude coordinates for all matching addresses found.

https://{cxadbaseurl}/api/secure/geocode?address={searchAddress}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • searchAddress the address string to be searched for

Example command:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X GET https://cxad.cxense.com/api/secure/geocode?address=New+York+City

 

This XML example shows the contents returned from a GET call:

<?xml version="1.0"?>
<cx:geocode xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:searchAddress>New York City</cx:searchAddress>
  <cx:result>
    <cx:address>New York, NY, USA</cx:address>
    <cx:latitude>40.7127837</cx:latitude>
    <cx:longitude>-74.0059413</cx:longitude>
  </cx:result>
  <cx:result>
    <cx:address>New York, IA 50238, USA</cx:address>
    <cx:latitude>40.8516701</cx:latitude>
    <cx:longitude>-93.25993179999999</cx:longitude>
  </cx:result>
</cx:geocode>

 

Last updated: