GET
/
ads
/
facebook
/
cities
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/facebook/cities?search=Manhattan"
{
  "status": "success",
  "cities": [
    {
      "key": "2447439",
      "name": "Manhattan",
      "type": "city",
      "countryCode": "US",
      "countryName": "United States",
      "region": "Kansas",
      "regionId": 3859,
      "supportsRegion": true,
      "supportsCity": true
    },
    {
      "key": "2703980",
      "name": "Manhattan",
      "type": "subcity",
      "countryCode": "US",
      "countryName": "United States",
      "region": "New York",
      "regionId": 3875,
      "supportsRegion": true,
      "supportsCity": true,
      "geoHierarchyLevel": "SUBCITY",
      "geoHierarchyName": "BOROUGH"
    }
  ],
  "count": 2
}
Available on Premium, Business, Enterprise plans.
Search for cities to be used for targeting when boosting an ad.
  • Cities use Facebook’s key identifier and support radius targeting.
  • If a returned city has supportsRegion true, the region for this city is available for targeting. If supportsCity is true, this city is available for targeting.
  • Some locations may be returned as subcity with additional hierarchy fields.

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY
Profile-Key
string
Profile Key of a User Profile.

Format: Profile-Key: PROFILE_KEY

Query Parameters

The search string to filter cities. Provide a partial or full city name.
limit
number
default:25
Maximum number of cities to return.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/facebook/cities?search=Manhattan"
{
  "status": "success",
  "cities": [
    {
      "key": "2447439",
      "name": "Manhattan",
      "type": "city",
      "countryCode": "US",
      "countryName": "United States",
      "region": "Kansas",
      "regionId": 3859,
      "supportsRegion": true,
      "supportsCity": true
    },
    {
      "key": "2703980",
      "name": "Manhattan",
      "type": "subcity",
      "countryCode": "US",
      "countryName": "United States",
      "region": "New York",
      "regionId": 3875,
      "supportsRegion": true,
      "supportsCity": true,
      "geoHierarchyLevel": "SUBCITY",
      "geoHierarchyName": "BOROUGH"
    }
  ],
  "count": 2
}