Graph API Version

Ad Account Targetingsearch

Reading

Unified search endpoint to get targeting descriptors with query

Example

Graph API Explorer
GET /v8.0/{ad-account-id}/targetingsearch 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}/targetingsearch',
    '{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}/targetingsearch",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/targetingsearch",
    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}/targetingsearch"
                                      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
allow_only_fat_head_interests
boolean

Allow only pre vetted interests

limit_type
enum {adgroup_id, genders, age_min, age_max, country_groups, countries, country, cities, city_keys, radius, regions, region_keys, zips, interests, location_cluster_ids, keywords, education_schools, education_majors, work_positions, work_employers, relationship_statuses, interested_in, locales, user_adclusters, excluded_user_adclusters, conjunctive_user_adclusters, custom_audiences, excluded_custom_audiences, college_years, education_statuses, connections, excluded_connections, friends_of_connections, user_event, dynamic_audience_ids, excluded_dynamic_audience_ids, rtb_flag, site_category, geo_locations, excluded_geo_locations, timezones, place_page_set_ids, location_expansion, page_types, publisher_platforms, effective_publisher_platforms, facebook_positions, effective_facebook_positions, instagram_positions, effective_instagram_positions, messenger_positions, effective_messenger_positions, device_platforms, effective_device_platforms, audience_network_positions, effective_audience_network_positions, whatsapp_positions, effective_whatsapp_positions, excluded_publisher_categories, excluded_publisher_list_ids, user_device, mobile_device_model, excluded_user_device, excluded_mobile_device_model, user_os, wireless_carrier, family_statuses, industries, life_events, political_views, politics, behaviors, income, net_worth, home_type, home_ownership, home_value, ethnic_affinity, generation, household_composition, moms, office_type, targeting_optimization, direct_install_devices, targeting_relaxation_types, engagement_specs, excluded_engagement_specs, product_audience_specs, excluded_product_audience_specs, exclusions, flexible_spec, exclude_reached_since, exclude_previous_days, app_install_state, fb_deal_id, interest_defaults_source, alternate_auto_targeting_option, contextual_targeting_categories, topic, format, trending, gatekeepers, follow_profiles, follow_profiles_negative, location_categories, user_page_threads, user_page_threads_excluded, is_whatsapp_destination_ad, marketplace_product_categories, instream_video_sponsorship_placements, prospecting_audience, brand_safety_content_severity_levels, catalog_based_targeting, brand_safety_content_filter_levels, excluded_brand_safety_content_types, id, is_instagram_destination_ad, instagram_hashtags, instream_video_skippable_excluded}

Limit the type of audience to retrieve

q
string

Search query

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

The regulated categories of the campaign.

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
368The action attempted has been deemed abusive or is otherwise disallowed
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.

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.