API Reference
Facebook LoginGETLogin dialog
Insights

Get campaign insights

GET/v27.0/{campaign_id}/insights
Base URL: https://meta-ads.mimicr.dev · provider: https://graph.facebook.com

Returns the performance of the campaign: 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

campaign_idstringrequired

ID of the campaign.

Example: "120200539998049712"

Query parameters

levelstring

Level of the rows: account, campaign, adset or ad. Defaults to the level of the node.

accountcampaignadsetad
fieldsstring

Comma-separated metrics and ids (see AdsInsights). Default impressions,spend. An unknown field returns (#100) <field> is not valid for fields param.

date_presetstring

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_year
time_rangestring

JSON {"since":"YYYY-MM-DD","until":"YYYY-MM-DD"} in the account time zone.

time_rangesstring

JSON list of time_range objects; overrides time_range and time_increment.

time_incrementstring

all_days (default), monthly or a number of days, 1 to 90 (1 = one row per day).

breakdownsstring

Comma-separated or JSON list. Mimicr supports age, gender, publisher_platform, platform_position, device_platform, region and country; other values return 2/1504041.

action_breakdownsstring

Default ["action_type"].

action_attribution_windowsstring

Attribution windows; default ["7d_click","1d_view"].

action_report_timestring

impression, conversion, mixed or lifetime.

impressionconversionmixedlifetime
filteringstring

JSON 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.

sortstring

One element: <field>_ascending, <field>_descending or actions:<action_type>_descending.

summarystring

Fields to total in a summary object beside data.

default_summaryboolean

true adds a summary with the default fields.

limitinteger

Maximum items per page (default 25).

afterstring

Cursor of paging.cursors.after: the page after.

beforestring

Cursor of paging.cursors.before: the page before.

Responses

200OK.
dataobject[]
Show child attributes
account_idstring

ID of the ad account, without the act_ prefix.

account_namestring

Name of the ad account.

account_currencystring

Currency of the ad account.

campaign_idstring

ID of the campaign.

campaign_namestring

Name of the campaign.

adset_idstring

ID of the ad set.

adset_namestring

Name of the ad set.

ad_idstring

ID of the ad.

ad_namestring

Name of the ad.

objectivestring

Objective of the campaign.

optimization_goalstring

What the ad set optimizes delivery for. It must be compatible with the campaign objective.

impressionsstring

Number of times the ads were on screen.

reachstring

Number of people who saw the ads at least once (estimated).

frequencystring

Average number of times each person saw the ads (impressions / reach).

spendstring

Amount spent, in major units of the account currency, as a decimal string ("13.11").

clicksstring

Number of clicks on the ads.

unique_clicksstring

Number of people who clicked.

inline_link_clicksstring

Clicks on links that lead to destinations on or off Meta.

ctrstring

Click-through rate, clicks / impressions × 100.

cpcstring

Average cost per click.

cpmstring

Average cost per 1,000 impressions.

cppstring

Average cost to reach 1,000 people.

actionsobject[]

Actions attributed to the ads, as {action_type, value}. CTWA conversations are onsite_conversion.messaging_conversation_started_7d.

Show child attributes
action_typestring

Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).

valuestring

Value of the metric, as a string.

7d_clickstring

Value in the 7-day click attribution window.

1d_viewstring

Value in the 1-day view attribution window.

action_valuesobject[]

Total value of the conversions attributed to the ads, in major units.

Show child attributes
action_typestring

Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).

valuestring

Value of the metric, as a string.

7d_clickstring

Value in the 7-day click attribution window.

1d_viewstring

Value in the 1-day view attribution window.

cost_per_action_typeobject[]

Average cost of each action type.

Show child attributes
action_typestring

Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).

valuestring

Value of the metric, as a string.

7d_clickstring

Value in the 7-day click attribution window.

1d_viewstring

Value in the 1-day view attribution window.

conversionsobject[]

Conversions attributed to the ads.

Show child attributes
action_typestring

Kind of action (link_click, lead, purchase, onsite_conversion.messaging_conversation_started_7d, …).

valuestring

Value of the metric, as a string.

7d_clickstring

Value in the 7-day click attribution window.

1d_viewstring

Value in the 1-day view attribution window.

date_startstring

First day of the row, YYYY-MM-DD in the ad account time zone.

date_stopstring

Last day of the row, YYYY-MM-DD in the ad account time zone.

agestring

Breakdown age: age range (18-24, 25-34, …).

genderstring

Breakdown gender: male, female or unknown.

publisher_platformstring

Breakdown publisher_platform: facebook, instagram, messenger, audience_network.

platform_positionstring

Breakdown platform_position: feed, story, reels, …

device_platformstring

Breakdown device_platform: mobile_app, mobile_web, desktop.

regionstring

Breakdown region: state or region name.

countrystring

Breakdown country: ISO-2 country code.

pagingobject

Cursor-based paging. next is absent on the last page and repeats every query param of the request, access_token included.

Show child attributes
cursorsobject
Show child attributes
beforestring

Cursor of the first item of the page.

afterstring

Cursor of the last item of the page.

nextstring

URL of the next page.

previousstring

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.
errorobjectrequired
Show child attributes
messagestringrequired

Description of the error.

Example: "(#100) The parameter special_ad_categories is required"
typestringrequired

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.

Example: "OAuthException"
codeintegerrequired

Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).

Example: 100
error_subcodeinteger

Error subcode with more detail (1885272 budget too low, 463 token expired, …).

Example: 1885272
is_transientboolean

Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.

error_user_titlestring

Title of the error, to show to people.

error_user_msgstring

Message of the error, to show to people.

error_dataobject

Extra data. blame_field_specs lists the params that caused a validation error.

Show child attributes
blame_field_specsstring[][]
fbtrace_idstringrequired

Internal support identifier of the request.

Example: "AbCdEf12345"