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

Forecast ad delivery

LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's adSupplyForecasts finder.

Each returned series carries a metricType (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a granularity (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted.

Non-LinkedIn accounts return available: false.


PlatformsLinkedIn
POST
/v1/ads/targeting/supply-forecast

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.getLinkedInSupplyForecast({  body: {    accountId: 'account_abc123',    adAccountId: 'adaccount_abc123',    spec: {      userOs: [        'string',      ],      userDevice: [        'string',      ],      countries: [        'string',      ],    },    timeRangeStart: 0,    timeRangeEnd: 0,  },});console.log(data);
{  "available": true,  "forecast": [    {      "metricType": "string",      "granularity": "DAILY",      "timeSeries": [        {          "timestamp": 0,          "value": 0,          "adForecastRange": {            "lowEnd": 0,            "highEnd": 0          }        }      ]    }  ]}
Was this page helpful?

Suggested bid and budget bounds

LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's `adBudgetPricing` finder. Non-LinkedIn accounts return `available: false` so clients can hide the pricing UI without treating it as a failure.

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.

accountId*string
adAccountId*string
spec*

Normalized, platform-agnostic ad-targeting spec. Every field is optional, an empty object targets the platform's default broadest audience. Field names are camelCase and identical across POST /v1/ads/create (the targeting object), POST /v1/ads/targeting/reach-estimate, and saved_targeting audiences, so a spec resolved once can be reused verbatim.

Entity ids (regions[].key, cities[].key, zips[].key, metros[].key, interests[].id, behaviors[].id) are the platform's opaque identifiers resolved via GET /v1/ads/targeting/search. A spec is therefore meaningful only for the platform it was built against, except the portable fields (countries, ageMin/ageMax, gender, incomeTier, languages) which carry across platforms. Fields a platform cannot honour are rejected on create, boost and targeting update with INVALID_FIELD_VALUE naming the offending field (never silently dropped).

campaignType?string

Defaults to SPONSORED_UPDATES.

Value in

  • "SPONSORED_UPDATES"
  • "SPONSORED_INMAILS"
  • "DYNAMIC"
timeRangeStart*integer

Unix ms. Must be in the future.

timeRangeEnd*integer

Unix ms. Must be after start and within LinkedIn's max horizon.

objectiveType?string
optimizationTarget?string

When set, the forecast assumes auto-bidding. When unset, competingBid is required.

dailyBudget?number

Either dailyBudget or totalBudget is required.

totalBudget?number
currency?string

ISO 4217, defaults to USD.

Length3 <= length <= 3
competingBid?

Required for manual-bid forecasts (when optimizationTarget is not set).

enableAudienceNetwork?boolean

Defaults to false. Required true for connectedTelevisionOnly.

enableAudienceExpansion?boolean

Defaults to false.

connectedTelevisionOnly?boolean

Defaults to false.