Ricky logorickyDocs

Get Meta ads insights

GET
/ads/insights

Spend, delivery and Meta's actions for the connected ad accounts over a period, per account, campaign, ad set or ad, computed live by Meta. Answers rule_violation when the organization has not connected Meta Ads, and forbidden when Meta no longer accepts its connection.

Scope: reports:read.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An organization API key, rky_live_…, created in Settings → API. Send it only from a server.

account_id?string

Only this connected ad account.

Match^\d+$
level?string

One row per ad account, campaign, ad set or ad.

Default"campaign"
Value in"account""campaign""ad_set""ad"
from*string

First day, YYYY-MM-DD, in the ad account's time zone.

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
to*string

Last day, YYYY-MM-DD, inclusive. At most 400 days after from.

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
breakdowns?string

Split rows by up to two of age, gender, country, region, publisher_platform, platform_position, device_platform, comma-separated.

Match^(age|gender|country|region|publisher_platform|platform_position|device_platform)(,(age|gender|country|region|publisher_platform|platform_position|device_platform))?$
daily?string

true returns one row per day instead of one for the period.

Default"false"
Value in"true""false"
object_id?string

Only this campaign, ad set or ad.

Match^\d+$

Response Body

Success.

application/json
  1. response
data*array<>
next_cursor*|

Pass as cursor for the next page; null on the last page.

curl -X GET 'https://getricky.ai/api/v1/ads/insights?from=2019-08-24&to=2019-08-24'
{  "data": [    {      "account_id": "string",      "campaign_id": "string",      "campaign_name": "string",      "ad_set_id": "string",      "ad_set_name": "string",      "ad_id": "string",      "ad_name": "string",      "date_start": "2019-08-24",      "date_stop": "2019-08-24",      "breakdown": {        "property1": "string",        "property2": "string"      },      "currency_code": "string",      "spend": 0,      "impressions": 0,      "reach": 0,      "frequency": 0,      "clicks": 0,      "ctr": 0,      "cpc": 0,      "cpm": 0,      "actions": [        {          "action_type": "string",          "value": 0        }      ],      "cost_per_action": [        {          "action_type": "string",          "value": 0        }      ]    }  ],  "next_cursor": "string"}