API reference Assets
Top creatives
Ranks creatives by spend, ROAS, CTR, impressions or purchases over a date window, from the Meta ads linked to each creative.
GET
/api/v1/public/assets/topScope: read. The key's creator needs access to Meta Ads. Ranking by money and seeing amounts need read:money.
Only creatives with at least one linked Meta ad that delivered in the window are ranked. Each creative's numbers are the sums over all of its linked ads.
Query parameters
metricstringquerydefault spendspend, roas, ctr, impressions or purchases. Without the Money scope, roas and purchases fall back to spend order and the response says so in note.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 10How many creatives, 1 to 25.
min_impressionsintegerquerydefault 0Skip creatives with fewer impressions in the window.
A ranking by roas skips creatives with no spend in the window.
Response
metric_usedstringThe metric the ranking actually used.
window.fromstringFirst day of the window.
window.tostringLast day of the window.
revenue_visiblebooleanWhether money fields are included.
countintegerCreatives returned.
creativesarrayRanked creatives.
creatives[].idstringAsset UUID.
creatives[].namestringAsset name.
creatives[].urlstringApp path of the asset, such as
/library/8f2c....creatives[].media_typestringimage, video or audio.creatives[].tagsarrayTags.
creatives[].hookstring | nullHook.
creatives[].anglestring | nullAngle.
creatives[].stylestring | nullStyle.
creatives[].impressionsintegerImpressions in the window.
creatives[].clicksintegerClicks in the window.
creatives[].ctrnumber | nullClicks divided by impressions.
creatives[].spendnumberMoney scope only.
creatives[].purchasesintegerMoney scope only.
creatives[].revenuenumberMoney scope only.
creatives[].roasnumber | nullMoney scope only.
notestringPresent when the metric fell back to spend order, or when nothing delivered in the window.
Example request
curl "https://api.pipory.com/api/v1/public/assets/top?metric=roas&days=30&limit=5" \
-H "Authorization: Bearer pip_your_key"
Example response
{
"metric_used": "roas",
"window": { "from": "2026-10-12", "to": "2026-11-10" },
"revenue_visible": true,
"count": 1,
"creatives": [
{
"id": "8f2c4a1e-6b3d-4c9f-a2e1-7d5b3c1a9e8f",
"name": "UGC hook v3",
"url": "/library/8f2c4a1e-6b3d-4c9f-a2e1-7d5b3c1a9e8f",
"media_type": "video",
"tags": ["ugc"],
"hook": "I stopped hitting snooze",
"angle": "Problem solution",
"style": "UGC",
"impressions": 48210,
"clicks": 1290,
"ctr": 0.0268,
"spend": 1840.5,
"purchases": 61,
"revenue": 7302.0,
"roas": 3.9674
}
]
}
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 |
422 | none | A parameter is out of range or not a valid date |
429 | rate_limited | Over the key's rate limit |