Reach frequency predictions for the ad account.
GET /v9.0/{ad-account-id}/reachfrequencypredictions 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}/reachfrequencypredictions',
'{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}/reachfrequencypredictions",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{ad-account-id}/reachfrequencypredictions",
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}/reachfrequencypredictions"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Reading from this edge will return a JSON formatted result:
{ "
data
": [], "paging
": {} }
data
paging
Error | Description |
---|---|
200 | Permissions error |
reachfrequencypredictions
edge from the following paths: Parameter | Description |
---|---|
budget int64 | Expected lifetime budget in cents in the currency for the ad account. Must be greater than the default budget limit. |
campaign_group_id numeric string or integer | The ID of the campaign which this prediction belongs to. |
day_parting_schedule list<Object> | Ad set schedule, representing a delivery schedule for a single day |
deal_id numeric string or integer | The ID of the deal which this prediction belongs to. |
destination_id int64 | The ID of the Page or the ID of the app which the ad promotes. Using the correct advertiser Page or app ID makes your predictions more accurate. Reach and cost predictions for feed are specific to a given ID. They take into account other ads running from the same Page, as well as the past creative quality of ads from the Page, which impacts cost. If the ad set has |
destination_ids list<numeric string or integer> | Array of ID's of the Facebook Page or App which the ad promotes. Also include the Instagram account ID if If the |
end_time int64 | Same as |
frequency_cap int64 | If However when you read the values back, this represents the lifetime frequency cap for the campaign duration. A separate read-only field called If |
instream_packages array<enum {NORMAL, PREMIUM, SPORTS, ENTERTAINMENT, BEAUTY, FOOD, SPANISH, REGULAR_ANIMALS_PETS, REGULAR_FOOD, REGULAR_GAMES, REGULAR_POLITICS, REGULAR_SPORTS, REGULAR_STYLE, REGULAR_TV_MOVIES}> | Instream package of the campaign. Reserve buying campaigns and self-serve contextual package campaigns need to set the targeting packages here. Those campaigns will only deliver to pages included in the targeting packages |
interval_frequency_cap_reset_period int64 | Custom period to reset frequency cap. In hours. Expressed as multiples of 24. For example, to show ad no more than 3 times every 48 hours, reset period should be set to 48 (hours) and |
num_curve_points int64 | How many grid points to return from the curve. |
objective string | Default value: REACH Objective of your reach and frequency campaign. Facebook uses this to create an optimized bid based on your objective. This does not modify you objective set at the ad campaign level. Of all possible ad objectives, you can only use these values in Facebook Reach and Frequency campaigns: |
prediction_mode int64 | Set |
reach int64 | The desired reach of the set, must be at least the minimum reach for the target country. This number is 1,000,000, in most cases. |
rf_prediction_id_to_share numeric string or integer | ID of a previously created prediction. The new prediction will also use the audience from the given prediction. |
start_time int64 | Unix timestamp for the set start time. |
stop_time int64 | Unix timestamp for the set stop time. Must be no greater than 8 weeks ahead of the current time. It should end after 6AM on the last day, in the ad account's timezone. |
story_event_type int64 | Whether or not to include mobile devices that cannot display different ad formats: You cannot create video ads if you set this flag to |
target_spec Targeting object | Targeting spec for reach and frequency prediction. The length of JSON serialized API targeting spec should not exceed 65000 characters after internal reformatting. You cannot: Website Custom Audiences and |
id
in the return type.id
: numeric string, Error | Description |
---|---|
2625 | The request for a reach frequency campaign is invalid. |
80004 | There 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. |
100 | Invalid parameter |
2627 | You do not have permission to run a reach and frequency campaign. |
2628 | There is an error in updating the state for the given prediction. |