API Reference
Get ad set insights
/v27.0/{adset_id}/insightshttps://meta-ads.mimicr.dev · provider: https://graph.facebook.comReturns the performance of the ad set: one row per object of level (per day with time_increment=1, per breakdown value with breakdowns). Numbers are strings; spend, cpc, cpm and action_values are in major units. Only rows with delivery are returned.
Requires ads_read. Calls count against the ads_insights business use case; the x-fb-ads-insights-throttle header shows the usage.
In Mimicr, delivery is generated hour by hour from the budget, the goal and a deterministic model, plus the real events of the sandbox (CTWA clicks, web clicks, leads, matched Conversions API purchases). More than 10,000 rows returns 100/1487534.
Authorization
Bearer token in the Authorization: Bearer <token> header. See Authentication.
Path parameters
ID of the ad set.
"120200539998049713"Query parameters
Level of the rows: account, campaign, adset or ad. Defaults to the level of the node.
accountcampaignadsetadComma-separated metrics and ids (see AdsInsights). Default impressions,spend. An unknown field returns (#100) <field> is not valid for fields param.
Relative period (default last_30d). last_Nd excludes today. Ignored when time_range or time_ranges is sent.
20 values
todayyesterdaythis_monthlast_monththis_quartermaximumdata_maximumlast_3dlast_7dlast_14dlast_28dlast_30dlast_90dlast_week_mon_sunlast_week_sun_satlast_quarterlast_yearthis_week_mon_todaythis_week_sun_todaythis_yearJSON {"since":"YYYY-MM-DD","until":"YYYY-MM-DD"} in the account time zone.
JSON list of time_range objects; overrides time_range and time_increment.
all_days (default), monthly or a number of days, 1 to 90 (1 = one row per day).
Comma-separated or JSON list. Mimicr supports age, gender, publisher_platform, platform_position, device_platform, region and country; other values return 2/1504041.
Default ["action_type"].
Attribution windows; default ["7d_click","1d_view"].
impression, conversion, mixed or lifetime.
impressionconversionmixedlifetimeJSON list of {field, operator, value}. Fields like ad.effective_status, campaign.id, adset.name, ad.impressions, action_type. Operators: EQUAL, NOT_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN, STARTS_WITH, ENDS_WITH. Archived and deleted objects only appear in per-object rows when {level}.effective_status includes them.
One element: <field>_ascending, <field>_descending or actions:<action_type>_descending.
Fields to total in a summary object beside data.
true adds a summary with the default fields.
Maximum items per page (default 25).
Cursor of paging.cursors.after: the page after.
Cursor of paging.cursors.before: the page before.
Responses
200OK.
Show child attributes
ID of the ad account, without the act_ prefix.
Name of the ad account.
Currency of the ad account.
ID of the campaign.
Name of the campaign.
ID of the ad set.
Name of the ad set.
ID of the ad.
Name of the ad.
Objective of the campaign.
What the ad set optimizes delivery for. It must be compatible with the campaign objective.
Number of times the ads were on screen.
Number of people who saw the ads at least once (estimated).
Average number of times each person saw the ads (impressions / reach).
Amount spent, in major units of the account currency, as a decimal string ("13.11").
Number of clicks on the ads.
Number of people who clicked.
Clicks on links that lead to destinations on or off Meta.
Click-through rate, clicks / impressions × 100.
Average cost per click.
Average cost per 1,000 impressions.
Average cost to reach 1,000 people.
Actions attributed to the ads, as {action_type, value}. CTWA conversations are onsite_conversion.messaging_conversation_started_7d.
Show child attributes
Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).
Value of the metric, as a string.
Value in the 7-day click attribution window.
Value in the 1-day view attribution window.
Total value of the conversions attributed to the ads, in major units.
Show child attributes
Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).
Value of the metric, as a string.
Value in the 7-day click attribution window.
Value in the 1-day view attribution window.
Average cost of each action type.
Show child attributes
Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).
Value of the metric, as a string.
Value in the 7-day click attribution window.
Value in the 1-day view attribution window.
Conversions attributed to the ads.
Show child attributes
Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).
Value of the metric, as a string.
Value in the 7-day click attribution window.
Value in the 1-day view attribution window.
First day of the row, YYYY-MM-DD in the ad account time zone.
Last day of the row, YYYY-MM-DD in the ad account time zone.
Breakdown age: age range (18-24, 25-34, …).
Breakdown gender: male, female or unknown.
Breakdown publisher_platform: facebook, instagram, messenger, audience_network.
Breakdown platform_position: feed, story, reels, …
Breakdown device_platform: mobile_app, mobile_web, desktop.
Breakdown region: state or region name.
Breakdown country: ISO-2 country code.
Cursor-based paging. next is absent on the last page and repeats every query param of the request, access_token included.
Show child attributes
Show child attributes
Cursor of the first item of the page.
Cursor of the last item of the page.
URL of the next page.
URL of the previous page.
400Error in the Graph envelope: 2/1504041 invalid breakdowns, 100 invalid field, 100/1504018 timeout (chaos), 80000 insights rate limit.
Show child attributes
Description of the error.
"(#100) The parameter special_ad_categories is required"OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.
"OAuthException"Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).
100Error subcode with more detail (1885272 budget too low, 463 token expired, …).
1885272Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.
Title of the error, to show to people.
Message of the error, to show to people.
Extra data. blame_field_specs lists the params that caused a validation error.
Show child attributes
Internal support identifier of the request.
"AbCdEf12345"