GET /v1/linkedin/ads_search

LinkedIn Ad Library API: search ads by keyword, country and date

Returns the LinkedIn Ad Library's search for a keyword, 24 ads a page, each read from its detail page: advertiser, payer, format, ad copy, run dates, impression range and targeting. Send keyword, and narrow it 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
curl 'https://api.virev.ai/v1/linkedin/ads_search?keyword=software&max_pages=1' \
  -H "Authorization: Bearer $VIREV_API_KEY"
python
import os
import requests

response = requests.request(
    "GET",
    "https://api.virev.ai/v1/linkedin/ads_search",
    params={
        "keyword": "software",
        "max_pages": "1",
    },
    headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())

Parameters

NameInTypeDescription
keyword requiredquerystringThe words to search ad copy for, up to 200 characters. Example software.
countries querystringComma-separated two-letter country codes.
start_date querystringOnly ads shown on or after this date, YYYY-MM-DD.
end_date querystringOnly ads shown on or before this date, YYYY-MM-DD.
since querystringNot accepted on this operation: its items carry no timestamp, so since returns 400 before billing.
max_pages queryintegerMaximum 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. Example 1.
cursor querystringOpaque 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 queryauto | cache_only | liveauto (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. Default auto.
get_raw querybooleanNot available on this operation: the upstream document is an HTML page, and true answers 400. The default false returns the normalized type. Default false.
Idempotency-Key headerstringReuse 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.

json
{
  "data": {
    "items": [
      {
        "id": "1659333856",
        "advertiser": {
          "id": "18034307",
          "username": null,
          "full_name": "Proa Energy",
          "is_verified": null,
          "is_private": null,
          "avatar_url": null,
          "latest_story_at": null,
          "extra": {
            "account_kind": "company"
          }
        },
        "advertiser_type": "company",
        "payer": "PROA ENERGY AUSTRALIA PTY LTD",
        "format": "Single Image Ad",
        "ad_copy": "Two stands. One connected platform.\n\nProa is heading to All Energy Australia in Melbourne this week, showcasing how NEXO connects technology in the field with intelligence in the cloud.\n\nOn 28–29 October, find us at:\n\nNEXO Site – Stand CC11…",
        "media_urls": [
          "https://media.licdn.com/dms/image/v2/D5622AQHXl2JqosGg-g/feedshare-shrink_1280/B56aF1F3SpGgAM-/0/1792965834406?e=2147483647&v=beta&t=7lPwRbalrI13SkwEUnF9gQZhTKN9qeAPSbluHLbn0LQ"
        ],
        "destination_urls": [
          "https://lnkd.in/g6TXUT8Y"
        ],
        "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/1659333856",
        "extra": {
          "advertiser_url": "https://www.linkedin.com/company/18034307",
          "partial": false,
          "creative_type": "SPONSORED_STATUS_UPDATE",
          "advertiser_logo_url": "https://media.licdn.com/dms/image/v2/D560BAQGRbQEZQ3Be5w/company-logo_100_100/B56aFcTzL3GgAI-/0/1792550056944/proa_energy_logo?e=1794441600&v=beta&t=_TMGmyan-I57viorZqpzvxpkAROHFiYmsbJPfGeSlpo"
        }
      },
      {
        "id": "1611783824",
        "advertiser": {
          "id": "31431064",
          "username": null,
          "full_name": "SWEEP",
          "is_verified": null,
          "is_private": null,
          "avatar_url": null,
          "latest_story_at": null,
          "extra": {
            "account_kind": "company"
          }
        },
        "advertiser_type": "company",
        "payer": "SWEEP",
        "format": "Single Image Ad",
        "ad_copy": "Verifiable ESG data is what unlocks green financing and stronger valuations.\n\nSweep keeps yours audit-ready before investors ever ask.",
        "media_urls": [
          "https://media.licdn.com/dms/image/v2/D4E10AQFdsTUz-0OgFw/image-shrink_1280/B4EaF1Fto0JgAc-/0/1792965794669/1440x1440-t1-d31png?e=2147483647&v=beta&t=bbC1OrzBPyxRWEnSDd_XB5dnWeKr1zXJ32dFbYwI0T0"
        ],
        "destination_urls": [
          "https://www.sweep.net/?utm_source=linkedin&utm_medium=paid_social&utm_campaign=tam_2026_q4_eu_awareness&utm_content=awareness_refresh_fs_intro-1_head-1_t1-d3_light-blue_cta-learn-more&utm_id=1210200664&hsa_acc=510063887&hsa_cam=1210200664&h…"
        ],
        "impression_start": "2026-10-25",
        "impression_end": "2026-10-27",
        "impressions_exact": null,
        "impressions_min": 1000,
        "impressions_max": 5000,
        "targeting": {
          "language": {
            "includes": [
              "English"
            ]
          },
          "location": {
            "includes": [
              "Finland",
              "Germany",
              "Luxembourg"
            ]
          },
          "parameters": {
            "audience": {
              "targeted": false,
              "excluded": true
            },
            "demographic": {
              "targeted": false,
              "excluded": false
            },
            "company": {
              "targeted": true,
              "excluded": true
            },
            "education": {
              "targeted": false,
              "excluded": false
            },
            "job": {
              "targeted": true,
              "excluded": true
            },
            "member_interests_and_traits": {
              "targeted": false,
              "excluded": false
            }
          }
        },
        "restricted": false,
        "url": "https://www.linkedin.com/ad-library/detail/1611783824",
        "extra": {
          "advertiser_url": "https://www.linkedin.com/company/31431064",
          "partial": false,
          "headline": "Turn ESG Data Into Financing Leverage",
          "creative_type": "SPONSORED_STATUS_UPDATE",
          "advertiser_logo_url": "https://media.licdn.com/dms/image/v2/D4E0BAQFO01Qi-WK2oQ/company-logo_100_100/company-logo_100_100/0/1720392364255/sweep_softwareforsustainability_logo?e=1794441600&v=beta&t=AR8cPzHJG9SJD3B9qZiBdFL7LOK7wtDm8LxvoID0aIM",
          "impressions_label": "1k-5k",
          "impressions_by_country": [
            {
              "country": "Sweden",
              "share": "100%",
              "percent": 100
            }
          ]
        }
      }
    ],
    "pages": [
      {
        "cursor": null,
        "fetched_at": "2026-10-27T20:38:49.650301+00:00",
        "count": 2
      }
    ],
    "next_cursor": "eyJvcCI6ImFkc19zZWFyY2giLCJwYWdpbmF0aW9uX3Rva2VuIjoiMTYxMTc0NjIxNC0xNzkyOTY1NjcyMTE0In0",
    "has_more": true,
    "stop_reason": "pages",
    "coverage": {
      "since": null,
      "oldest_at": null,
      "since_reached": false
    }
  },
  "meta": {
    "source": "live",
    "fetched_at": "2026-10-27T20:38:49.650301+00:00",
    "cost": "$0.0025",
    "balance": "$0.9970",
    "request_id": "req_99c54409d98a97601f5f67e4e35e72a5"
  }
}

How it works

The Ad Library's search for a keyword, 24 ads 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

StatusWhen
400The request parameters are invalid.
401Missing, malformed, or revoked API key.
402Balance is too low for this request.
404cached=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.
429Over 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.
502The upstream fetch failed. You are not charged.
503Billing could not be confirmed, so no upstream data was returned.
504The upstream request timed out. You are not charged.