GET /v1/linkedin/company_ads
LinkedIn company ads API: every ad an advertiser ran, by company
Returns the ads one advertiser ran, 24 a page, each read from its Ad Library detail page. Send company as the numeric company id, or a name, which matches every advertiser whose Ad Library name holds it; filter with countries, start_date and end_date. max_pages=1 answers one page at once, and other values start a job you poll.
- Price
- $0.0025 per 24 results
- Billing
- $0.0025/24
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl 'https://api.virev.ai/v1/linkedin/company_ads?company=Microsoft&max_pages=1' \
-H "Authorization: Bearer $VIREV_API_KEY"import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/linkedin/company_ads",
params={
"company": "Microsoft",
"max_pages": "1",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
company required | query | string | The advertiser’s numeric company id, or a name, which matches every advertiser whose Ad Library name holds it. |
countries | query | string | Comma-separated two-letter country codes. |
start_date | query | string | Only ads shown on or after this date, YYYY-MM-DD. |
end_date | query | string | Only ads shown on or before this date, YYYY-MM-DD. |
since | query | string | Not accepted on this operation: its items carry no timestamp, so since returns 400 before billing. |
max_pages | query | integer | Maximum pages to fetch. -1 walks until exhaustion or since with no page cap, and must be written. Omitted, since alone bounds the walk; with neither, the job stops after 10 pages. Any positive integer is accepted. 1 returns one page synchronously with HTTP 200; any other value creates a durable job with HTTP 202. |
cursor | query | string | Opaque next_cursor from an earlier answer of this operation, also with get_raw=true. A native LinkedIn cursor from a raw page answers 400. Result download cursors belong to the results route. |
cached | query | auto | cache_only | live | auto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts LinkedIn (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. cache_only reads one saved page per request: omit max_pages or pass 1, and continue with next_cursor. |
get_raw | query | boolean | Not available on this operation: the upstream document is an HTML page, and true answers 400. The default false returns the normalized type. |
Idempotency-Key | header | string | Reuse this key with the same inputs to recover a lost job submission. A different input with the same key returns 409. |
Example response
The example response of the API reference, with lists cut to their first 3 items and long text shortened.
{
"data": {
"items": [
{
"id": "1658527466",
"advertiser": {
"id": "107855954",
"username": null,
"full_name": "Microsoft in Business",
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {
"account_kind": "company"
}
},
"advertiser_type": "company",
"payer": "Starcom Mediavest Group, Inc",
"format": "Carousel Ad",
"ad_copy": "Real demos. Real results. Real people. Real ROI. #MicrosoftFrontierTour is a one day, in-person experience for leaders like you. Request to attend.",
"media_urls": [
"https://media.licdn.com/dms/image/v2/D5610AQHoFff0Kyfyhg/image-pad_1200_1200/B4DaFqojGmJcAQ-/0/1792790377167?e=1793739600&v=beta&t=OHE99kfx3SyctzbVduX4BQkSw7pWgYvzGx0m_RaQQ5c",
"https://media.licdn.com/dms/image/v2/D5610AQGS7fdY0qJE2w/image-pad_1200_1200/B4DaFqojHAIwAU-/0/1792790377118?e=1793739600&v=beta&t=Uwt0B0RP9pDmQnSeG1IMxToxGNlXQItAGMwUN7RWuaE",
"https://media.licdn.com/dms/image/v2/D5610AQFLtVkNzLcFFQ/image-pad_1200_1200/B4DaFqojHpKUAQ-/0/1792790377190?e=1793739600&v=beta&t=USda3hfY4dkXz-oMCmmSKWuLvN0WaSCQB8p30EKv4-E"
],
"destination_urls": [],
"impression_start": null,
"impression_end": null,
"impressions_exact": null,
"impressions_min": null,
"impressions_max": null,
"targeting": {},
"restricted": false,
"url": "https://www.linkedin.com/ad-library/detail/1658527466",
"extra": {
"advertiser_url": "https://www.linkedin.com/company/107855954",
"partial": false,
"creative_type": "SPONSORED_UPDATE_CAROUSEL",
"advertiser_logo_url": "https://media.licdn.com/dms/image/v2/D560BAQGfxIUgUdeVww/company-logo_100_100/B56ZgZynj1HQAQ-/0/1752779356692?e=1794441600&v=beta&t=bBUsTdPotSMRELuKplZoxINU0E82LfVzbR-grzoT0fo"
}
},
{
"id": "1593053133",
"advertiser": {
"id": "18224890",
"username": null,
"full_name": "INKUBIT - Microsoft AI & Business Applications Partner",
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {
"account_kind": "company"
}
},
"advertiser_type": "company",
"payer": "Inkubit Business Solutions GmbH",
"format": "Single Image Ad",
"ad_copy": "Ein KI-Agent für Deine Organisation. Nicht als Demo, sondern selbst gebaut.\n\nIm November laden wir Nonprofits gemeinsam mit Microsoft zu unserem 𝗢𝗻𝗹𝗶𝗻𝗲 𝗔𝗜 𝗔𝗴𝗲𝗻𝘁 𝗶𝗻 𝗮 𝗗𝗮𝘆 𝗪𝗼𝗿𝗸𝘀𝗵𝗼𝗽 ein.\n\nDu arbeitest hands-on an ein…",
"media_urls": [
"https://media.licdn.com/dms/image/v2/D4E22AQFsDzgdiPpmuw/feedshare-shrink_1280/B4EaFj4cj1JoAM-/0/1792677104162?e=2147483647&v=beta&t=chp9vSE2TRVbaFktfWllNQ4CoXmYmLwb4JD_nLi8yRI"
],
"destination_urls": [
"https://lnkd.in/ej_faEwu"
],
"impression_start": "2026-10-23",
"impression_end": "2026-10-27",
"impressions_exact": null,
"impressions_min": 1000,
"impressions_max": 5000,
"targeting": {
"language": {
"includes": [
"English"
]
},
"location": {
"includes": [
"Germany",
"Switzerland",
"Austria"
]
},
"parameters": {
"audience": {
"targeted": false,
"excluded": false
},
"demographic": {
"targeted": false,
"excluded": false
},
"company": {
"targeted": true,
"excluded": false
},
"education": {
"targeted": false,
"excluded": false
},
"job": {
"targeted": true,
"excluded": false
},
"member_interests_and_traits": {
"targeted": false,
"excluded": false
}
}
},
"restricted": false,
"url": "https://www.linkedin.com/ad-library/detail/1593053133",
"extra": {
"advertiser_url": "https://www.linkedin.com/company/18224890",
"partial": false,
"creative_type": "SPONSORED_STATUS_UPDATE",
"impressions_label": "1k-5k",
"impressions_by_country": [
{
"country": "Switzerland",
"share": "61%",
"percent": 61
},
{
"country": "Germany",
"share": "22%",
"percent": 22
},
{
"country": "Austria",
"share": "18%",
"percent": 18
}
]
}
}
],
"pages": [
{
"cursor": null,
"fetched_at": "2026-10-27T20:38:57.137087+00:00",
"count": 2
}
],
"next_cursor": "eyJvcCI6ImNvbXBhbnlfYWRzIiwicGFnaW5hdGlvbl90b2tlbiI6IjE2MTE1NjMzNDQtMTc5Mjc1NTM3NzcyNCJ9",
"has_more": true,
"stop_reason": "pages",
"coverage": {
"since": null,
"oldest_at": null,
"since_reached": false
}
},
"meta": {
"source": "live",
"fetched_at": "2026-10-27T20:38:57.137087+00:00",
"cost": "$0.0025",
"balance": "$0.9970",
"request_id": "req_930a531a1898c4d3cc72cba39fcdcd5c"
}
}How it works
The ads one advertiser ran, 24 a page, each read from its detail page. Returns Page[LinkedInAd] under data. LinkedIn is read as a signed-out guest and every upstream document is an HTML page, so get_raw is not available.
The default request creates a durable job (202). Use max_pages=1 for one synchronous Page response (200). Poll status_url, then read results_url with its opaque cursor. Acquisition stops at the first of since, max_pages, or exhaustion. Jobs continue after disconnects. Result responses are bounded to 3 MiB; this does not limit the crawl. Supply Idempotency-Key to recover a lost submission response; reuse it with the same inputs. LinkedIn sets every page’s size, so there is no page_size.
A field LinkedIn does not carry is null, a list it does not carry is [], and LinkedIn-only facts sit under extra. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.
Billing: $0.0025 per 24 unique returned items (one native page), rounded up to a minimum of one billing unit. Jobs settle once after successful completion. Submission, polling and repeat downloads are free.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the LinkedIn account or item does not exist (not_found). You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |