OverviewProductsPlatformsAPI ReferenceResources
Campaigns and Ads

Rank ads by performance

GEThttps://zernio.com/api/v1/ads/performance

Returns an ads account's ads ranked by spend, impressions, clicks, results or ROAS over a date range, each with its creative (type, thumbnail, headline, body, link) and campaign.

Use it to see which creatives perform best. accountId is sibling-expanded like /v1/ads/timeline.

Money is ranked by its raw amount, so pass adAccountId when the connection's ad accounts bill in different currencies.

A Meta range older than the imported history answers 202 with backfillPending: true and the covered part; repeat the request until it returns 200.

PlatformsMetaGoogleTikTokLinkedInPinterestXRedditMicrosoft

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Query parameters

accountIdstringRequired

Account ID. Sibling-expanded to its linked posting and ads pair. An id the API key cannot reach answers 404.

adAccountIdstring

Optional platform-native ad account ID (e.g. Meta act_…) to rank one ad account only.

fromDatestring (date)Required

Inclusive start of the range (YYYY-MM-DD).

toDatestring (date)Required

Inclusive end of the range (YYYY-MM-DD). Max 730-day range.

platformstringOne of facebook | instagram | tiktok | linkedin | pinterest | google | twitter | openai | reddit | microsoft

Restrict to one platform.

sortBystringDefault spendOne of spend | impressions | clicks | conversions | roas

Metric the ads are ranked by, highest first.

limitintegerDefault 50

How many ads to return.

Responses

Success· the request worked

Errors· the request failed

GET/v1/ads/performance
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaigns.listAdsByPerformance({  query: {    accountId: 'account_abc123',    fromDate: '2026-01-15',    toDate: '2026-01-15',  },});console.log(data);
{  "ads": [    {      "adId": "string",      "platformAdId": "string",      "platform": "string",      "name": "string",      "status": "string",      "campaignName": "string",      "adSetName": "string",      "currency": "string",      "creative": {        "type": "image",        "thumbnailUrl": "string",        "headline": "string",        "body": "string",        "linkUrl": "string"      },      "metrics": {        "spend": 0,        "impressions": 0,        "clicks": 0,        "ctr": 0,        "conversions": 0,        "costPerConversion": 0,        "purchaseValue": 0,        "roas": 0,        "conversionsByType": {          "property1": 0,          "property2": 0        }      }    }  ]}
OpenAPI specification
Was this page helpful?