operation_status will return 471 to signal if your custom audiences have been flagged.https://graph.facebook.com/{API_VERSION}/act_{AD_ACCOUNT_ID}/customaudiences.curl \
-F 'name=My lookalike audience' \
-F 'subtype=LOOKALIKE' \
-F 'origin_audience_id=<SEED_AUDIENCE_ID>' \
-F 'lookalike_spec={"type":"similarity","country":"US"}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
| Name | Description |
|---|---|
idtype: integer | ID of lookalike audience |
| Name | Description |
|---|---|
nametype: string | Required. Custom Audience name |
origin_audience_idtype: long | Required. ID of Custom Audience. Origin audiences must have at least 100 members. |
lookalike_spectype: array | Required. See description below. |
lookalike_spec.typetype: string | Required. Set either type or ratio.similarity or reach |
lookalike_spec.starting_ratiotype: float | Optional. Start percentage for lookalike. For example, starting_ratio 0.01 and ratio 0.02 creates a lookalike from 1% to 2% of a lookalike segment. starting_ratio must be less than ratio |
lookalike_spec.ratiotype: float | Required. Set either type or ratio.0.01-0.20 incremented by 0.01. Top x% of original audience in a selected country |
lookalike_spec.allow_international_seedstype: boolean | Optional. At least 100 seed audience members from a country. If not, allow_international_seeds set to true means Facebook finds this minimum number of audience members in another country. Default false. |
lookalike_spec.countrytype: string | Required. Set country or location_spec.Find lookalike audience members in this country |
lookalike_spec.location_spectype: array | Required. Either country or location_spec.Find audience members in these locations. List of countries or country groups such as Asia |
lookalike_spec.location_spec.geo_locationstype: array | Required. At least one entry under countries or country_groups.Include these locations |
lookalike_spec.location_spec.geo_locations.countriestype: array of strings | Optional. Target countries. Array of country codes, see Targeting Search API, Countries.
Example: 'countries': ['US'] |
lookalike_spec.location_spec.geo_locations.country_groupstype: array of strings | Optional. Target countries in global regions and free trade areas. Array of country group codes. For full options, see Targeting, Location, country_groups and Targeting Search, country_groups.
Example: 'country_groups': ['asia','mercosur'] |
lookalike_spec.location_spec.excluded_geo_locationstype: array | Optional. Locations to exclude |
lookalike_spec.location_spec.excluded_geo_locations.countriestype: array of strings | Optional. Same as countries under geo_locations |
lookalike_spec.location_spec.excluded_geo_locations.country_groupstype: array of strings | Optional. Same as country_groups under geo_locations |
ratio to represent the top x% of the audience in the selected country. ratio should be from 1%-20% and in intervals of 1%.curl \
-F 'subtype=LOOKALIKE' \
-F 'lookalike_spec={
"origin_ids": "<CAMPAIGN_ID>",
"starting_ratio": 0.03,
"ratio": 0.05,
"conversion_type": "campaign_conversions",
"country": "US"
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
| Name | Description |
|---|---|
lookalike_spectype: array | Required. See description below. |
lookalike_spec.origin_idstype: array of integers | Required. Array of ad object ids. People who convert on these ads are used to model a lookalike. One or more campaign IDs or ad set IDs, or a mix of them. |
lookalike_spec.conversion_typetype: string | Required. campaign_conversions. Indicates audience is a campaign conversion lookalike |
lookalike_spec.countrytype: string | Required. Country to find lookalike members. |
lookalike_spec.allow_international_seedstype: boolean | Optional. At least 100 seed audience members from a country. If not, allow_international_seeds set to true means Facebook finds this minimum number of members in another country. Defaults to false. |
lookalike_spec.starting_ratiotype: float | Optional. Start percentage for lookalike. For example, starting_ratio 0.01 and ratio 0.02 creates a lookalike from 1% to 2% of a lookalike segment. starting_ratio must be less than ratio |
lookalike_spec.ratiotype: float | Required. Range of 0.01-0.20. Top x% of original audience in the selected country. |
curl \
-F 'subtype=LOOKALIKE' \
-F 'lookalike_spec={
"ratio": 0.01,
"country": "US",
"page_id": "<PAGE_ID>",
"conversion_type": "page_like"
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/customaudiences
| Name | Description |
|---|---|
lookalike_spectype: array | Required. See description below. |
lookalike_spec.page_idtype: int | Required. Facebook ID of the page whose fans will be used for the lookalike |
lookalike_spec.conversion_typetype: string | Required. page_like - Indicates that this is a page fan lookalike |
lookalike_spec.countrytype: string | Required. The country to find the lookalike people. The default is ‘US’ |
lookalike_spec.allow_international_seedstype: boolean | Optional. You need at least 100 seed audience members from a country. If this minimum is not satisfied, allow_international_seeds set to true means Facebook finds this minimum number of seed audience members in another country. Defaults to false. |
lookalike_spec.starting_ratiotype: float | Optional. Starting percentage of the lookalike. For example, a starting_ratio of 0.01 and a ratio of 0.02 would create a lookalike from the 1% to 2% lookalike segment. The value of starting_ratio should always be less than that of ratio |
lookalike_spec.ratiotype: float | Required. Range 0.01-0.20. How much of the country the lookalike should target. |
operation_status of 471, attempts to create a lookalike audience based on the seed audience will fail with an error.{ "error": { "message": "Invalid parameter", "code": 100, "error_subcode": 1713232, "error_user_title": "Seed audience restricted", "error_user_msg": "The seed audience you selected cannot be used to create a lookalike audience because it has integrity restrictions. Please use a different seed audience", }, }
AND targeting. To target when you create an ad:curl \
-F 'name=My AdSet' \
-F 'optimization_goal=REACH' \
-F 'billing_event=IMPRESSIONS' \
-F 'bid_amount=2' \
-F 'daily_budget=1000' \
-F 'campaign_id=<CAMPAIGN_ID>' \
-F 'targeting={
"custom_audiences": [{"id":"<LOOKALIKE_AUDIENCE_ID>"}],
"geo_locations": {"countries":["US"]}
}' \
-F 'status=ACTIVE' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v25.0/act_<AD_ACCOUNT_ID>/adsets
lookalike_audience_ids specifies which lookalike audiences were generated from this audience. {
"id": "6006164557194",
"account_id": 12345,
"approximate_count": 816400,
"lookalike_audience_ids": [
6006183285954,
6006183285955
],
"name": "Boys Apparel",
"parent_audience_id": 0,
"parent_category": "Custom",
"status": "ready",
"subtype": "CUSTOM",
"type": 4,
"type_name": "Advertiser Generated",
"time_updated": 1362439491
},
subtype of 2. We also return lookalike_spec, an array in this format:| Name | Description |
|---|---|
typetype: string | similarity, reach or custom_ratio - Always returned |
starting_ratiotype: float | Returned if starting_ratio specified |
ratiotype: float | Multiple of 0.01. Returned if type is custom_ratio |
countrytype: string | Country code |
origintype: array | See description below. |
origin.deletedtype: boolean | true, Returned when the origin deleted |
origin.idtype: int | Origin ID |
origin.nametype: string | Origin name |
origin.typetype: string | custom_audience or page |
target_countriestype: array of strings | All countries used to create audience |
subtype is LOOKALIKE:{
"id": "6006183285954",
"account_id": 12345,
"approximate_count": 1782100,
"name": "Boys Apparel_lookalike_US_Similarity",
"origin_audience_id": 6006567610735,
"parent_audience_id": 0,
"parent_category": "Custom",
"status": "ready",
"subtype": "LOOKALIKE",
"type": 4,
"type_name": "Advertiser Generated",
"time_updated": 1362506552
},
/{lookalike_audience_ID}?fields=delivery_status. This returns a JSON response with delivery_status or code 200 if an audience populates:"delivery_status": {
"code": 200,
"description": "This audience is ready for use."
},
approximate_count, operation_status, and delivery_estimate.| Field | Changes for Inactive Lookalikes |
|---|---|
approximate_count | You are not able to retrieve a size. A call for this field returns -1 for inactive lookalikes. |
operation_status | 450: This lookalike audience is inactive. It can be used in ads but will not have an estimate till the campaign is published.100: If an audience hasn’t been used in an active ad set for over 2 years, it will begin to expire. Expiring audiences that remain unused for 90 days will be deleted.471: The lookalike audience has been flagged for integrity reasons. |
delivery_estimate | You are not able to retrieve a delivery estimate. A call for this field returns -1 for inactive lookalikes. This field is available under Ad Account and Ad Set nodes. Both exhibit the same behavior for inactive lookalikes. |
delete_time | When an audience’s operation_status has been marked as expiring (code 100), the delete_time field tells you in Unix time when the audience will be deleted. |
delete_time field will be marked with the estimated deletion time (i.e., 90 days from the time of flagging) when the audience is scheduled to be deleted.operation_status or delete_time fields.location_spec and country parameters from lookalike audience creation is currently delayed. Updates on when this change will go into effect will be forthcoming.location_spec and country parameters from lookalike audience creation. The location for the lookalikes will be defined by the country location in the campaign’s targeting specification. The target location won’t be a part of the lookalike audience specification. The reach estimate of the campaign using a newly created lookalike will be populated only in a few hours after the ad being published.act_{AD_ACCOUNT_ID}/customaudiencescurl POST \
-F 'name=My lookalike audience' \
-F 'subtype=LOOKALIKE' \
-F 'origin_audience_id=<SEED_AUDIENCE_ID>' \
-F ‘lookalike_spec={
"is_financial_service":false,
"allow_international_seeds":true,
"ratio":0.01,
"type":"custom_ratio"}
’}\
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/customaudiences
lookalike_spec.countrylookalike_spec.location_speclookalike_spec.location_spec.geo_locationslookalike_spec.location_spec.geo_locations.countrieslookalike_spec.location_spec.geo_locations.country_groupslookalike_spec.location_spec.excluded_geo_locationslookalike_spec.location_spec.excluded_geo_locations.countrieslookalike_spec.location_spec.excluded_geo_locations.country_groupsact_{AD_ACCOUNT_ID}?fields=approximate_countapproximate_count field will return -1 for all lookalike audiences.{
"approximate_count": -1,
"id": "6126486105659",
}
{AD_ACCOUNT_ID}?fields=delivery_status{AD_ACCOUNT_ID}?fields=operation_statusdelivery_status field for old lookalike audiences with location specifications will return a code 400 with a This audience is disabled. description. For new lookalike audiences it will return a code 200 response.operation_status field will return a retirement notification for old lookalike audiences with location specifications. For new lookalike audiences it will return a code 200 and Normal description response.excluded_custom_audiences, flexible_spec, and exclusions in the campaign.act_{AD_ACCOUNT_ID}/adsetscurl POST \
-F 'targeting={
"geo_locations":{
"countries":["US"],
},
"age_min":25,
"age_max":40,
"custom_audiences":[{"id": <CUSTOM_AUDIENCE_ID>}]
‘}\
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets
{
"error": {
"message": "Invalid parameter",
"type": "FacebookApiException",
"code": 100,
"error_data": {
"blame_field_specs": [["targeting" ] ]
},
"error_subcode": 192342134,
"is_transient": false,
"error_user_title": "Missing Location while using Lookalike",
"error_user_msg": "You need to use a location with your lookalike audience.",
"fbtrace_id": "F78cCCJoZPx"
},
"__fb_trace_id__": "F78cCCJoZPx",
"__www_request_id__": "AcwlIc7_uK5uTXjzjIa38yc"
}
{
"error": {
"message": "Invalid parameter",
"type": "FacebookApiException",
"code": 100,
"error_data": {
"blame_field_specs": [["targeting" ] ]
},
"error_subcode": 192342135,
"is_transient": false,
"error_user_title": "",
"error_user_msg": "Please ask the owner of the audience 1234 to share the new lookalike which does not contain location with you. You will be able to use the new audience"
"fbtrace_id": "F78cCCJoZPx"
},
"__fb_trace_id__": "F78cCCJoZPx",
"__www_request_id__": "AcwlIc7_uK5uTXjzjIa38yc"
}
{AD_ACCOUNT_ID}/adaccounts?adaccounts={SHARED_TO_AD_ACCOUNT_ID}act_{AD_ACCOUNT_ID}/reachestimateact_{AD_ACCOUNT_ID}/delivery_estimatetargeting_status parameter with one of the following descriptions:lookalike_container_without_country — A new lookalike does not have a country specified in the campaign targeting. A country is needed to see the estimated users number.lookalike_container_without_delivery_lookalike — A new lookalike does not have a corresponding backend lookalike. The new lookalike needs to be used in an Ad Set for it to actually have reach.none — There is no issue with the reach.reachestimate endpoint will return -1 for the users parameter the first time a new lookalike audience and country target is used; thereafter the estimated user count will be returned.estimate_dau and estimate_mau parameters will return -1 for the users parameter the first time a new lookalike audience and country target is used; thereafter the estimated user count will be returned..// Reach estimate response
{
"users": -1,
"estimate_ready": true,
"targeting_status": "lookalike_container_without_delivery_lookalike"
}
// Delivery estimate response
{
"data": [{
"daily_outcomes_curve": [{
"spend": 0,
"reach": 0,
"impressions": 0,
"actions": 0
}],
"estimate_dau": -1,
"estimate_mau": -1,
"estimate_ready": true ,
"targeting_status": "lookalike_container_without_delivery_lookalike"
}]
}
location_spec and country parameters from lookalike audience creation is currently delayed. Updates on when this change will go into effect will be forthcoming.location_spec and country parameters from lookalike audience creation is currently delayed. Updates on when this change will go into effect will be forthcoming.