Location type returned as null in search call for some locations

targeting
api

#1

Account Id : 18ce53uo3nm

API Call
twurl -H ‘ads-api.twitter.com’ ‘/1/targeting_criteria/locations?q=texas’

API Response

{  
  "data_type":"targeting_criterion",
  "data":[  
    {  
      "name":"Texas, USA",
      "country_code":"US",
      "location_type":"REGION",
      "targeting_value":"e0060cda70f5f341",
      "targeting_type":"LOCATION"
    },
    {  
      "name":"Texas, Queensland, Australia",
      "country_code":"AU",
      "location_type":"CITY",
      "targeting_value":"01e1ebc82f49b63a",
      "targeting_type":"LOCATION"
    },
    {  
      "name":"Texas City, Texas City, Houston TX, TX, USA",
      "country_code":"US",
      "location_type":"POSTAL_CODE",
      "targeting_value":"a23772be43dca6c9",
      "targeting_type":"LOCATION"
    },
    {  
      "name":"Texas City, Texas City, Houston TX, TX, USA",
      "country_code":"US",
      "location_type":"POSTAL_CODE",
      "targeting_value":"072ff9c0403f4431",
      "targeting_type":"LOCATION"
    },
    {  
      "name":"Texas City, US",
      "country_code":"US",
      "location_type":null,
      "targeting_value":"05959d7d3c4d4c27",
      "targeting_type":"LOCATION"
    },
    {  
      "name":"Texas, US",
      "country_code":"US",
      "location_type":null,
      "targeting_value":"01330bbf19b293ef",
      "targeting_type":"LOCATION"
    }
  ],
  "request":{  
    "params":{  
      "q":"texas"
    }
  },
  "next_cursor":null
}

Location type being returned as null in last 2 locations.


#2

Thanks for bringing this to our attention, @npurwar. This looks like a bug. We’ll investigate and get back to you.


#3

@npurwar: We’ll be deploying a fix for this issue in the next few days. Thanks for bringing this to our attention!


#4

@npurwar: The fix has now been deployed. We don’t show the results that had the null location_type.

$ twurl -H ads-api.twitter.com "/1/targeting_criteria/locations?q=texas" | jq
{
  "data_type": "targeting_criterion",
  "data": [
    {
      "name": "Texas, USA",
      "country_code": "US",
      "location_type": "REGION",
      "targeting_value": "e0060cda70f5f341",
      "targeting_type": "LOCATION"
    },
    {
      "name": "Texas, Queensland, Australia",
      "country_code": "AU",
      "location_type": "CITY",
      "targeting_value": "01e1ebc82f49b63a",
      "targeting_type": "LOCATION"
    },
    {
      "name": "Texas City, Texas City, Houston TX, TX, USA",
      "country_code": "US",
      "location_type": "POSTAL_CODE",
      "targeting_value": "a23772be43dca6c9",
      "targeting_type": "LOCATION"
    },
    {
      "name": "Texas City, Texas City, Houston TX, TX, USA",
      "country_code": "US",
      "location_type": "POSTAL_CODE",
      "targeting_value": "072ff9c0403f4431",
      "targeting_type": "LOCATION"
    }
  ],
  "request": {
    "params": {
      "q": "texas"
    }
  },
  "next_cursor": null
}