Get daily account metrics
Returns daily aggregate metrics across all ads in a SocialAccount as a single
time series — one row per calendar day in the requested range. Use this for
dashboards that draw a daily-spend or daily-conversions chart, instead of
calling /v1/ads/tree once per day.
accountId is required. The lookup is sibling-expanded so passing the metaads
ID also includes ads under the linked facebook / instagram posting account
(and vice-versa) — same convention as /v1/ads/tree and /v1/ads.
Date range defaults to the last 90 days. Capped at 730 days. Ranges older
than the ingested history return a 202 immediately with the covered part
and backfillPending: true while the rest is backfilled in the background;
repeat the request shortly until it returns 200 with full data.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
Social account ID. Sibling-expanded to its linked posting↔ads pair.
Optional platform-native ad account ID (e.g. Meta act_…, TikTok advertiser ID). Use when the connection wraps multiple platform ad accounts and the chart should show one only. Note: rows ingested before 2026-05-13 don't carry this column; the recurring 7-day re-sync repopulates them naturally.
Inclusive start of metrics range (YYYY-MM-DD). Defaults to 90 days ago.
dateInclusive end of metrics range (YYYY-MM-DD). Defaults to today. Max 730-day range.
dateRestrict to one platform.
"facebook" | "instagram" | "tiktok" | "linkedin" | "pinterest" | "google" | "twitter" | "openai"Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaigns.getAdsTimeline({ query: { accountId: 'account_abc123', },});console.log(data);{
"rows": [
{
"date": "2019-08-24",
"spend": 0,
"impressions": 0,
"reach": 0,
"clicks": 0,
"engagement": 0,
"ctr": 0,
"cpc": 0,
"cpm": 0,
"conversions": 0,
"costPerConversion": 0,
"actions": {
"property1": 0,
"property2": 0
},
"actionValues": {
"property1": 0,
"property2": 0
},
"purchaseValue": 0,
"roas": 0
}
],
"backfillPending": true
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "Unauthorized"
}Get ad details GET
Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
Pause or resume a campaign PUT
Updates the status of all ads in a campaign. Makes one platform API call (not per-ad) since status cascades through the campaign hierarchy. Ads in terminal statuses (rejected, completed, cancelled) are automatically skipped.