API reference Ads
Meta ads summary
Returns the Meta ad account's totals and top ads for a window, or one ad's window, lifetime and daily numbers with its linked creatives.
GET
/api/v1/public/ads/summaryScope: read. The key's creator needs access to Meta Ads. Money fields need read:money.
Call it without ad_id for the account view, or with ad_id for one ad. The numbers come from the nightly Meta sync.
Query parameters
ad_idstringqueryA Meta ad's Pipory UUID (from
linked_ads[].id on Get an asset or top_ads_by_spend[].id here). Omit for the account.daysintegerquerydefault 30Window length ending today (UTC), 1 to 365. Used when
date_from is not set.date_fromstringqueryStart date,
YYYY-MM-DD.date_tostringqueryEnd date,
YYYY-MM-DD. Defaults to today.limitintegerquerydefault 5How many top ads to list, 1 to 25. Account view only.
Every metrics object below has impressions, clicks and ctr, plus spend, purchases, revenue and roas when revenue_visible is true.
Account response
window.fromstringFirst day of the window.
window.tostringLast day of the window.
account_metricsobjectTotals for the window across the ads synced from your Meta ad account.
active_adsintegerAds whose Meta status is
ACTIVE.top_ads_by_spendarrayAds with the most spend in the window:
id, name, status, campaign, url (app path) and their metrics.ad_libraryobject | nullThe brand's own ads read from Meta's public Ad Library, or
null when there are none. They have no results until Meta is connected.ad_library.notestringExplains that these ads carry no results.
ad_library.adsintegerAd Library ads found.
ad_library.activeintegerHow many are still running.
ad_library.longest_runningarrayThe longest-running ones:
id, source, name, page, status (active or ended), days_running, variants, started, ad_library_url, url.revenue_visiblebooleanWhether money fields are included.
One ad response
ad.idstringThe ad's Pipory UUID.
ad.namestringAd name.
ad.statusstring | nullMeta's effective status, else its configured status.
ad.campaignstring | nullCampaign name.
ad.adsetstring | nullAd set name.
ad.headlinestring | nullThe creative's headline.
ad.bodystring | nullThe creative's primary text, first 500 characters.
ad.urlstringApp path of the ad.
windowobjectfrom and to.window_metricsobjectThe ad's totals in the window.
lifetime_metricsobjectThe ad's totals over every synced day.
dailyarrayOne entry per day in the window with
date and the metrics, at most the last 31 days.linked_assetsarrayLibrary creatives linked to the ad:
id, name, url, media_type, tags, hook, angle, style.revenue_visiblebooleanWhether money fields are included.
When ad_id points at an Ad Library row, the response is ad (the Ad Library fields above), results: null, a note and revenue_visible.
Example request
curl "https://api.pipory.com/api/v1/public/ads/summary?days=7&limit=2" \
-H "Authorization: Bearer pip_your_key"
Example response
{
"window": { "from": "2026-11-04", "to": "2026-11-10" },
"account_metrics": {
"impressions": 912400,
"clicks": 18320,
"ctr": 0.0201,
"spend": 12480.75,
"purchases": 402,
"revenue": 41988.4,
"roas": 3.3642
},
"active_ads": 37,
"top_ads_by_spend": [
{
"id": "c1b2a3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"name": "UGC hook v3 - 9x16",
"status": "ACTIVE",
"campaign": "Prospecting Q4",
"url": "/ads?ad=c1b2a3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"impressions": 210300,
"clicks": 5120,
"ctr": 0.0243,
"spend": 3120.0,
"purchases": 118,
"revenue": 12390.0,
"roas": 3.9712
}
],
"ad_library": null,
"revenue_visible": true
}
Errors
| Status | Code | Meaning |
|---|---|---|
401 | invalid_api_key | Missing, unknown, revoked or expired key |
403 | insufficient_scope | The key or its creator's role cannot read Meta Ads |
403 | upgrade_required | The workspace is not on a paid plan |
404 | none | No Meta ad with that ad_id in this workspace |
422 | none | A parameter is out of range, ad_id is not a UUID, or a date is invalid |
429 | rate_limited | Over the key's rate limit |