Zernio
APIFor you
Zernio
APIFor you
API Reference

Targeting

Search targeting optionsGETSuggested bid and budget boundsPOSTForecast ad deliveryPOSTBrowse targeting categoriesGETEstimate audience reachPOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Targeting

Estimate audience reach

Estimates how many people a targeting setup would reach before you create a campaign.

Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta delivery_estimate, LinkedIn audienceCounts, X audience_summary, Pinterest audience_sizing).

Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return available: false with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.


PlatformsMetaLinkedInPinterestX
POST
/v1/ads/targeting/reach-estimate

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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.adtargeting.estimateAdReach({  body: {    accountId: 'account_abc123',    adAccountId: 'adaccount_abc123',    spec: {      userOs: [        'string',      ],      userDevice: [        'string',      ],      countries: [        'string',      ],    },  },});console.log(data);
{  "available": true,  "lower": 0,  "upper": 0,  "daily": 0,  "active": 0,  "currency": "string",  "estimateReady": true}
Was this page helpful?

Browse targeting categories

Shows Meta's full tree of detailed targeting categories for an ad account, so you can browse options without a keyword. The whole Meta detailed-targeting category tree of one ad account (Meta's `GET /act_{ad_account_id}/targetingbrowse`), as one flat list you can render as a tree. Use it to show what can be targeted without a keyword; use `GET /v1/ads/targeting/search` to find an entry by name. Every node is one of two kinds: - **Selectable entity** (`selectable: true`): an interest, behavior or demographic Meta gives an id. `id` plus `type` is what a targeting spec takes. `interests`, `behaviors` and `industries` ids go in `TargetingSpec.interests`, `behaviors` and `workIndustries` on `POST /v1/ads/create`; every other type goes in `rawTargeting.flexible_spec` under its `type` as the key. `life_events`, `family_statuses` and `income` take objects (`{ "flexible_spec": [{ "life_events": [{ "id": "6017476616183" }] }] }`), while `education_statuses` and `relationship_statuses` take the bare number (`{ "flexible_spec": [{ "education_statuses": [3] }] }`): Meta answers an object there with a 500. - **Organizational node** (`selectable: false`, `id: null`): a category such as `Demographics > Financial > Income` that only groups other nodes and cannot be targeted. A few carry a `type` and have no children (`Schools`, `Employers`, `Job titles`, `Fields of study`, `Undergrad years`): those are open-ended categories Meta only exposes through search (`dimension=workEmployer` / `workPosition` on the search endpoint). `nodeId` identifies a node within this response and `parentNodeId` points at its parent (`null` for the three roots `Demographics`, `Interests`, `Behaviors`). A selectable node's `nodeId` is `{type}:{id}`, because Meta reuses small ids across types (education status 3 and relationship status 3 are different entities). An organizational node's `nodeId` is its full path joined with ` > `. Labels are kept exactly as Meta sends them, including stray leading or trailing spaces, because Meta has sibling nodes that differ only by whitespace. The interests branch is Meta's curated browse list (a few hundred entries), not every interest Meta can target: search finds the long tail. **No pagination.** Meta returns the whole catalog in one response (about 770 nodes) and ignores `limit`, so there is no cursor. Narrow it with `type`, `parentNodeId` and `selectable` instead; they are applied by Zernio. The catalog is cached for an hour per ad account and connection.

Search the public Ad Library

Searches Meta's or LinkedIn's public Ad Library to see what ads other advertisers run, for competitor and market research. Meta's Ad Library (`GET /ads_archive`) is searched with Zernio's own developer access, so `platform=meta` needs no connected account at all. LinkedIn's Ad Library (`GET /rest/adLibrary`) runs on a connected `linkedin` / `linkedinads` account, passed as `accountId`. Passing a Meta account as `accountId` also selects Meta. Rows are returned in the platform's raw shape under `data`; `paging.after` is an opaque cursor on both (`null` when exhausted). **Meta coverage.** Political and social-issue ads are searchable worldwide. Every other ad is in the archive only if it was delivered to the EU or UK within the last year, so a US-only commercial advertiser is invisible. Spend, impressions and demographics are political-only fields and are left out of the default projection; request them via `fields`. All customers share Zernio's Meta quota, so a `429` means back off for a minute. **LinkedIn coverage.** Ads served after June 1 2023, worldwide, kept for a year after their last impression. EU-delivered ads carry impression ranges and the disclosed targeting facets. Pages are capped at 25 ads (`limit` > 25 is a 400); `after` is the next offset. Which params apply: `q`, `countries`, `limit`, `after` on both; `pageIds`, `adType`, `status`, `platforms`, `mediaType`, `languages`, `searchType`, `fields`, `since`, `until` are Meta-only; `advertiser` is LinkedIn-only. Passing a param the account's platform does not support is a 400 naming the param.

accountId*string

Zernio account ID on the target ad platform (the estimate runs against its platform).

adAccountId*string

Required. The platform ad-account ID the reach call runs against (Meta act_..., LinkedIn numeric sponsoredAccount ID, Pinterest ad-account ID, X account ID) - every backing reach API is scoped to one ad account. Get it from GET /v1/ads/accounts.

spec*

The targeting spec to estimate. Same shape used by POST /v1/ads/create.

optimizationGoal?string

Optional. The optimization goal the estimate should assume (platform's own vocabulary, e.g. Meta REACH, LINK_CLICKS, OFFSITE_CONVERSIONS). Some platforms vary the estimate by goal; omit to use the platform default.