Zernio
APIFor you
Zernio
APIFor you
Platforms

LinkedIn Ads

Overview

Build

Create adsBoost a postLead Gen FormsCreative formats

Target

TargetingMatched AudiencesBid pricing & forecasts

Measure

AnalyticsConversions APIInsight TagURL tracking tags

Operate

Manage adsAd Library

Reference

Media & limits
Dashboard
OverviewPlatformsAPI ReferenceResources
LinkedIn Ads

Ad Library

Search LinkedIn's public ad archive by keyword or advertiser with GET /v1/ads/library, using a connected LinkedIn account's token.


By the end of this page, you can search LinkedIn's public Ad Library by keyword or advertiser with GET /v1/ads/library.

Before you start

The call runs on the token of a connected linkedin or linkedinads account, passed as accountId.

The member token you already hold is enough. Access is granted to the Zernio app, not per scope.

Meta is the other way round: platform=meta needs no account at all (Meta Ad Library).

Needs a payment method on file. The billing owner must have a card on file or a legacy paid plan (AppSumo counts as free).

Searches are not charged, but the archive quota is shared across every Zernio customer. Without a payment method the call returns 403 payment_required; add a card on the billing page and retry.

Search the archive

import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data: page } = await zernio.adlibrary.searchAdLibrary({
  query: {
    accountId: '66b2e19d8c3f5a7e9d0b1c2d',
    advertiser: 'Microsoft',
    countries: 'DE',
    since: '2027-01-01',
    limit: 25
  }
});

for (const ad of page.data) {
  console.log(ad.details.advertiser.advertiserName, ad.details.type, ad.adUrl);
}

Response (200), rows in LinkedIn's raw shape under data:

{
  "platform": "linkedin",
  "data": [
    {
      "isRestricted": false,
      "adUrl": "https://www.linkedin.com/ad-library/detail/1521996423",
      "details": {
        "type": "SPONSORED_STATUS_UPDATE",
        "advertiser": {
          "advertiserName": "Microsoft",
          "advertiserUrl": "https://www.linkedin.com/company/1035"
        },
        "adStatistics": {
          "firstImpressionAt": 1798848000000,
          "latestImpressionAt": 1799452800000,
          "totalImpressions": { "from": 5000, "to": 10000 },
          "impressionsDistributionByCountry": []
        },
        "adTargeting": [
          { "facetName": "Location", "includedSegments": ["Deutschland"], "excludedSegments": [] }
        ]
      }
    }
  ],
  "paging": { "after": "25", "total": 27147 }
}

paging.after is the next offset (null on the last page). paging.total is the number of matching ads.

What is in the archive

Every ad served on LinkedIn after June 1 2023, worldwide, kept for one year after its last impression.

New ads show up 24 to 48 hours after their first impression.

Each row carries:

  • adUrl, the public detail page with the creative
  • isRestricted
  • details, with the ad type (SPONSORED_STATUS_UPDATE, SPONSORED_VIDEO, ...) and the advertiser (advertiserName, advertiserUrl, and the disclosed adPayer when it differs)

EU ads. Ads delivered to the EU also carry the DSA transparency data:

  • adStatistics: firstImpressionAt, latestImpressionAt, totalImpressions as a from and to range, impressionsDistributionByCountry
  • adTargeting: one entry per facet (Language, Location, Company, Job, ...) with the included and excluded segments

Ads that never reached the EU have an empty adTargeting and no adStatistics.

Search parameters

Every search needs q, advertiser or both. Sending neither returns a 400 on q.

ParamNotes
qKeyword search over the ad text.
advertiserAdvertiser (Page) name. Combine with q to narrow one advertiser's ads.
countriesISO alpha-2 codes the ads reached, comma-separated. Omit to search every market (ALL is Meta-only and rejected here).
since, untilDelivery window, YYYY-MM-DD. Either bound alone is fine; Zernio fills the other one.
limit, afterAt most 25 rows per page (LinkedIn's cap; more is a 400). Pass paging.after back for the next page.

On a LinkedIn account, the Meta-only filters return a 400 naming the param: pageIds, adType, status, platforms, mediaType, languages, searchType, fields.

If it fails

A 403 with code feature_not_available is the one a first-time caller hits. LinkedIn refused Ad Library access for that token, because the archive is granted to the app, not to a scope.

The error carries LinkedIn's own wording when it sends one:

{
  "error": "LinkedIn refused Ad Library access for this token.",
  "type": "permission_error",
  "code": "feature_not_available",
  "platform": "linkedin"
}

A 403 with code linkedin_reconnect_required is the other one. LinkedIn rejected the token itself, so reconnect the account and retry.

Validation 400s. Zernio checks limit, countries, after and the q-or-advertiser requirement before it calls LinkedIn.

Those 400s carry Zernio's own message and name the param that failed. For example, "LinkedIn Ad Library returns at most 25 ads per page." on limit.

Only a 400 LinkedIn itself raises, such as an unrecognised country code, carries LinkedIn's wording.

Related

  • Meta Ad Library: the same endpoint with platform=meta.
  • Search the public Ad Library: every parameter.
  • Connecting accounts: connect the LinkedIn account whose token searches.
Was this page helpful?

Manage ads

Pause and resume LinkedIn campaign groups, campaigns and creatives, change a campaign's budget, swap a creative's media, rename, duplicate and delete.

Media & limits

LinkedIn Ads media requirements per format, what the API cannot do, and the errors LinkedIn returns most often.

On this page

Before you startSearch the archiveWhat is in the archiveSearch parametersIf it failsRelated