Geotargeting API Examples

Examples on this page

Search for a geotarget

To search for a geotarget by name, you can use the GET /geo/api/search/v2/geo endpoint.

Specify:

geo_types

Type of geopgrahic area you are searching for:

  • country

  • metro

  • region

  • city

  • postalcode

starts_with

Segment that you want to query

For example, to search for a city named Austin:

Request:

curl --user dev@example.com:my-password-is-great \
"https://services.adroll.com/geo/api/search/v2/geo?apikey=MYAPIKEY&geo_types=city&starts_with=austin"

Response:

{
  "results": [
    {
      "country": {
        "iso2": "US",
        "name": "United States"
      },
      "eid": "WDK2JF5UU5HQ3CPXRM8GEO",
      "name": "Austin",
      "name_localized": null,
      "type": "city"
    },
    {
      "country": {
        "iso2": "CA",
        "name": "Canada"
      },
      "eid": "3EQ6XSDC2NECXD4EBW8GEO",
      "name": "Austin",
      "name_localized": null,
      "type": "city"
    }
  ]
}