Skip to content
API reference Ads summary
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/summary

Scope: 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_idstringquery
A 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 30
Window length ending today (UTC), 1 to 365. Used when date_from is not set.
date_fromstringquery
Start date, YYYY-MM-DD.
date_tostringquery
End date, YYYY-MM-DD. Defaults to today.
limitintegerquerydefault 5
How 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.fromstring
First day of the window.
window.tostring
Last day of the window.
account_metricsobject
Totals for the window across the ads synced from your Meta ad account.
active_adsinteger
Ads whose Meta status is ACTIVE.
top_ads_by_spendarray
Ads with the most spend in the window: id, name, status, campaign, url (app path) and their metrics.
ad_libraryobject | null
The 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.notestring
Explains that these ads carry no results.
ad_library.adsinteger
Ad Library ads found.
ad_library.activeinteger
How many are still running.
ad_library.longest_runningarray
The longest-running ones: id, source, name, page, status (active or ended), days_running, variants, started, ad_library_url, url.
revenue_visibleboolean
Whether money fields are included.

One ad response

ad.idstring
The ad's Pipory UUID.
ad.namestring
Ad name.
ad.statusstring | null
Meta's effective status, else its configured status.
ad.campaignstring | null
Campaign name.
ad.adsetstring | null
Ad set name.
ad.headlinestring | null
The creative's headline.
ad.bodystring | null
The creative's primary text, first 500 characters.
ad.urlstring
App path of the ad.
windowobject
from and to.
window_metricsobject
The ad's totals in the window.
lifetime_metricsobject
The ad's totals over every synced day.
dailyarray
One entry per day in the window with date and the metrics, at most the last 31 days.
linked_assetsarray
Library creatives linked to the ad: id, name, url, media_type, tags, hook, angle, style.
revenue_visibleboolean
Whether 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

StatusCodeMeaning
401invalid_api_keyMissing, unknown, revoked or expired key
403insufficient_scopeThe key or its creator's role cannot read Meta Ads
403upgrade_requiredThe workspace is not on a paid plan
404noneNo Meta ad with that ad_id in this workspace
422noneA parameter is out of range, ad_id is not a UUID, or a date is invalid
429rate_limitedOver the key's rate limit