Graph API Version

Ad Account Targetingsuggestions

Reading

Retrieve suggestions for given targeting specs.

Example

Graph API Explorer
GET /v5.0/{ad-account-id}/targetingsuggestions HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{ad-account-id}/targetingsuggestions',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{ad-account-id}/targetingsuggestions",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/targetingsuggestions",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-account-id}/targetingsuggestions"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

ParameterDescription
limit_type
enum {interests, user_adclusters, behaviors, family_statuses, home_value, income, industries, life_events, interested_in, relationship_statuses, education_statuses, college_years, work_employers, work_positions, education_majors, education_schools, location_categories}

Used to limit the type of audience to be retrieved.

regulated_categories
array<enum {NONE, EMPLOYMENT, HOUSING, CREDIT}>

The regulated categories of the campaign

targeting_list
list<JSON or object-like arrays>

List of targeting specs. Example: [{"type":"interests", "id":1}, {"type":"interests", "id":2}, {"type":"behaviors", "id":3}]

type
enum {interests, user_adclusters, behaviors, family_statuses, home_value, income, industries, life_events, interested_in, relationship_statuses, education_statuses, college_years, work_employers, work_positions, education_majors, education_schools, location_categories}

id
int64

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of AdAccountTargetingUnified nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
200Permissions error

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.