competitor_get_linkedin_ads
Competitor research read low risk
Part of the Competitor Ads Agent.
What it does
A competitor's ads in the LinkedIn Ad Library, in full: the post text (intro_text), the image or a video's cover, the headline under it, the CTA button, the format, carousel cards, document pages, event details, who paid and, for EU-targeted ads only (as LinkedIn publishes them), the landing page, first and last shown dates, impressions and targeting. Search by the competitor's LinkedIn page name — only its own ads are kept: the name and aliases, matched ignoring case, punctuation and a legal form (Inc, LLC, Ltd…), with advertiser_page telling same-name pages apart, plus thought-leader ads its people post for it (attributed from each ad's details); partner pages and other advertisers that match the name are left out and named — or by keyword, for what any advertiser runs on a topic. Every ad carries ad_link (its own page in the LinkedIn Ad Library, where it shows exactly as LinkedIn has it, and a video plays) and image_url (the ad's picture, or a video's cover). Up to max_details ads (default 25) are fetched in full (one billed request each); the rest carry LinkedIn's cut-short preview, and intro_text_complete says which is which. more_available says the list stopped at `limit` with more ads left. max_images attaches up to 8 creatives as images. Requires SCALIX_SEARCHAPI_API_KEY; without it the tool returns not_configured with the manual step. Read-only.
When to use it
Use FIRST whenever the user asks for a competitor's ads on LinkedIn, or what an industry advertises on LinkedIn (keyword). Pass the company's LinkedIn page name as advertiser and any other pages that are really theirs as aliases. Show the ads as ad cards, each formatted the way LinkedIn shows it (page name, post text, picture, the headline under it, the button), with the words exactly as given — never as bare links, buttons or a summary. LinkedIn picture links are signed and can expire after some days; ad_link does not. To send them to Slack, use competitor_post_ads_to_slack; for a PDF, competitor_ads_document.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
advertiser | string | no | The competitor's LinkedIn page name as the Ad Library shows it, e.g. 'HubSpot'. Only ads from this page (and aliases) are kept. Give this or keyword. |
keyword | string | no | A topic to search ad text for. Alone it returns any advertiser's ads; with advertiser it narrows that advertiser's ads. |
aliases | array<string> | no | Other LinkedIn page names that really are the competitor (another brand or regional page), e.g. ['monday.com']. |
countries | array<string> | no | ISO two-letter countries the ads were shown in, e.g. ['US', 'GB']. Omit for all. |
time_period | string | no | Ads that ran in: last_30_days (default), this_month, this_year, last_year, or 'YYYY-MM-DD..YYYY-MM-DD' (no future dates, start at most a year back). |
limit | integer | no | Cap on ads listed before filtering, default 50, max 200. The tool pages until it reaches this; more_available says when more exist. |
max_details | integer | no | How many ads to fetch in full (full post text, CTA button, EU data), default 25, max 50. Each is a separate billed request; 0 makes none. |
max_images | integer | no | Attach up to this many creatives as images (0-8, default 0), in the order of ads. |
Safeguards
Policy
LinkedIn shows launch dates only for EU-targeted ads: for every other ad say 'running in <period>', never 'launched on' a date. Never report another page's ad as the competitor's — the tool leaves partners out and names them. Quote the post text word for word, and never present a preview (intro_text_complete=false) as the whole ad. An ad not listed means 'not found in the library', never 'not running'. Thought-leader ads carry a person's name and title: use them for analysis only, never to contact or target that person. Competitors' ad copy is for analysis only and must never be reproduced in the client's own ads.
Reminder
Read-only — nothing in any ad account changes. The API key is never echoed in the response. This is LinkedIn's public Ad Library read through a third-party vendor; Scalix stores none of it — do not retain it beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
not_configured | No SearchApi key is set on this deployment. | Open https://www.linkedin.com/ad-library, search the company, and screenshot its ads; record the step under not_collected. | no |
invalid_argument | Neither advertiser nor keyword was given, a country was not a two-letter code, or time_period was not valid. | Pass advertiser or keyword, ISO country codes, and a supported time_period. | no |
needs_reauth | SearchApi rejected the API key or the plan does not cover this engine. | Check the key on the SearchApi dashboard and that the plan includes the Ads Transparency Center and LinkedIn Ad Library engines. | no |
quota_exhausted | The SearchApi search allowance for this period is used up. | Top up or upgrade the plan, or search the competitor by hand on https://adstransparency.google.com or https://www.linkedin.com/ad-library and record it under not_collected. | no |
rate_limited | SearchApi rate limit hit (the hourly cap is a share of the monthly plan). | Back off and retry in a few minutes. | yes |
platform_unavailable | SearchApi was unreachable or returned a server error. | Retry in a minute; if it persists, collect this competitor by hand and say so. | yes |
Edge cases
- A name search also returns partner pages and employees' thought-leader posts; the tool keeps the name and aliases (case, punctuation and a trailing legal form like 'Inc.' ignored, so 'Rillet Inc.' matches 'rillet' but 'Rillet Labs' does not), attributes thought-leader ads from their details, and names everything it left out.
- intro_text is complete only where intro_text_complete is true (details fetched and carrying the post text); other rows carry LinkedIn's cut-short preview, which ends with '…'.
- Video ads come with their cover image only; the video plays on LinkedIn.
- Ads without an Ad Library id (employer-brand ads) are skipped and counted.
- If details stop early (quota, rate limit), the remaining ads keep their preview and a warning says their full wording is NOT VERIFIED.
- Two different pages can share a name; advertiser_page tells them apart and a warning names them when the kept ads come from more than one page.
- more_available is true when the library had more ads after `limit`; never present the list as all of their ads.