Our LinkedIn Ad Library API allows you to scrape ads from LinkedIn Ad Library. You can search ads by keyword, advertiser, or payer, and filter them by country, date, impressions, and targeting parameters. Results are returned as structured JSON with details about each ad, such as its advertiser, format, text, images, and a link to its details on LinkedIn Ad Library.

The API endpoint is https://serpapi.com/search?engine=linkedin_ad_library

Head to the playground for a live and interactive demo.

API parameters

Search query

q

Optional

Parameter defines the word or phrase to search for in the ads (e.g., coffee), like the Keyword field on LinkedIn Ad Library.

Parameter can be omitted when advertiser, payer, or a filter parameter (country, period, start_date, impressions_min, included_targeting, or excluded_targeting) is set.

Advertiser filters

advertiser

Optional

Parameter defines the name of the company or advertiser to search ads from (e.g., Microsoft), like the Company or advertiser field on LinkedIn Ad Library. Similar names are matched too, so Microsoft also returns ads from Microsoft Surface.

payer

Optional

Parameter defines the name of the person or organization that paid for the ads (e.g., Microsoft), like the Payer field on LinkedIn Ad Library. The payer can differ from the advertiser: some ads from Microsoft are paid for by Spark Foundry.

Geographic location

country

Optional

Parameter defines the countries to filter the ads by, as two-letter country codes (e.g., US for the United States). Multiple countries can be separated by commas (e.g., US,DE). Head to the LinkedIn Ad Library countries page for a full list of supported countries.

Date range

period

Optional

Parameter defines the time period to search ads in.

Options:
last_30_days - Last 30 days
this_month - This month
this_year - This year
last_year - Last year

Parameter can't be used together with start_date and end_date parameters.

start_date

Optional

Parameter defines the start date of a custom date range. The format is YYYY-MM-DD (e.g., 2026-11-04). It must be used together with end_date.

LinkedIn Ad Library only searches ads from the last year, so the date must be within the last year and in the past. Earlier or future dates return no ads.

end_date

Optional

Parameter defines the end date of a custom date range. The format is YYYY-MM-DD (e.g., 2026-12-03). It must be used together with start_date, and be later than it.

The date must be in the past: an end date of today returns no ads.

Advanced filters

impressions_min

Optional

Parameter defines the minimum number of impressions of the ads (e.g., 1000). It must be used together with impressions_max.

LinkedIn Ad Library only returns ads from the EU and Brazil with this filter.

impressions_max

Optional

Parameter defines the maximum number of impressions of the ads (e.g., 10000). It must be used together with impressions_min, and be greater than it.

LinkedIn Ad Library only returns ads from the EU and Brazil with this filter.

included_targeting

Optional

Parameter defines the targeting parameters that the ads include their audience by, like Inclusions applied in the Targeting parameters filter on LinkedIn Ad Library. Multiple targeting parameters can be separated by commas (e.g., job,education), and ads using any of them are returned.

Options:
language - Language
location - Location
audience - Audience
demographic - Demographic
company - Company
education - Education
job - Job
interests_and_traits - Interests and Traits

LinkedIn Ad Library only returns ads from the EU and Brazil with this filter.

excluded_targeting

Optional

Parameter defines the targeting parameters that the ads exclude their audience by, like Exclusions applied in the Targeting parameters filter on LinkedIn Ad Library. Multiple targeting parameters can be separated by commas (e.g., audience,job), and ads using any of them are returned. The same options as included_targeting are supported.

With included_targeting, ads must match both parameters. Set the same targeting parameter in both of them for Both on LinkedIn Ad Library.
With language or demographic, the ads can start on the next page: the first page then has no ads, only serpapi_pagination.
LinkedIn Ad Library only returns ads from the EU and Brazil with this filter.

sort_by

Optional

Parameter defines the order of the ads. By default, the newest ads come first.

Options:
newest - Newest to oldest
oldest - Oldest to newest

Pagination

next_page_token

Optional

Parameter defines the token to retrieve the next page of ads. It's returned as serpapi_pagination.next_page_token. LinkedIn Ad Library returns up to 24 ads per page.

SerpApi parameters

engine

Required

Set parameter to linkedin_ad_library to use the LinkedIn Ad Library API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the LinkedIn Ad Library results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

zero_trace

Optional

Enterprise only. Parameter enables ZeroTrace mode. It can be set to false (default) or true. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the format of the result. It can be set to json (default) to get a structured JSON of the results, html to get the raw HTML retrieved, or md to get a Markdown-formatted version optimized for LLMs and AI agents.

json_restrictor

Optional

Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.

API results

JSON results

JSON output includes structured data for Ads.

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML results

HTML output is useful to debug JSON results or support features not yet supported by SerpApi. It gives you the raw HTML results from LinkedIn Ad Library.

Markdown results

Markdown output is optimized for LLMs and AI agents. It provides a curated view of the JSON results in a token-efficient format using tables, markdown links, and YAML frontmatter.

To access, use the output=md parameter, the /search.md endpoint, or request header Accept: text/markdown.

API examples

Example with q: Coffee

q searches for a word or phrase in the ads, like the Keyword field on LinkedIn Ad Library. The newest ads come first, and search_information.total_results is the number of ads that match the search.

Example with q: Coffee

JSON Example

{
  "search_metadata": {
    "id": "6adc995efd6b6f4e9271f16f",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/ucppFyqHKpsOin1WcZBXU48K-is6s1DZjiIxLhlB9Wk/6adc995efd6b6f4e9271f16f.json",
    "markdown_endpoint": "https://serpapi.com/searches/ucppFyqHKpsOin1WcZBXU48K-is6s1DZjiIxLhlB9Wk/6adc995efd6b6f4e9271f16f.md",
    "created_at": "2026-10-24 11:41:18 UTC",
    "processed_at": "2026-10-24 11:41:18 UTC",
    "linkedin_ad_library_url": "https://www.linkedin.com/ad-library/search?keyword=Coffee",
    "raw_html_file": "https://serpapi.com/searches/ucppFyqHKpsOin1WcZBXU48K-is6s1DZjiIxLhlB9Wk/6adc995efd6b6f4e9271f16f.html",
    "total_time_taken": 1.1
  },
  "search_parameters": {
    "engine": "linkedin_ad_library",
    "q": "Coffee"
  },
  "search_information": {
    "total_results": 90077
  },
  "ads": [
    {
      "position": 1,
      "ad_id": "1656775326",
      "format": "single_image",
      "advertiser": {
        "name": "Gabi Barat",
        "headline": "CFO, Strategic and Operational CFO, Business Transformation | M&A | Cash Flow Optimization | Private Equity | Pharmaceuticals | Healthcare | Nuclear Medicine | Radiology | Dialysis | Hospital Systems | SNF |",
        "thumbnail": "https://media.licdn.com/dms/image/v2/D5603AQFYhWtRXwnPAg/profile-displayphoto-scale_100_100/B56aAaer7UHMAc-/0/1787150648955?e=1794441600&v=beta&t=X1SQRtSflcEB8bjY0Oo9TEI1YXY7PnWZWA8c-rAVYGc"
      },
      "snippet": "Thumbs up from Kidney Week 2026 in Denver! 👍\n\nThere's something energizing about being in a room full of people who've …",
      "image": "https://media.licdn.com/dms/image/v2/D5622AQGbsF-efVj7jw/feedshare-shrink_1280/B56aFlhuEsJkAM-/0/1792704701374?e=2147483647&v=beta&t=ibBFt0xm344lH8pEU4M4jMO5oANb0EyUEnC4psZN8ZU",
      "details_link": "https://www.linkedin.com/ad-library/detail/1656775326"
    },
    {
      "position": 2,
      "ad_id": "1592708583",
      "format": "video",
      "advertiser": {
        "name": "Forbes",
        "thumbnail": "https://media.licdn.com/dms/image/v2/D4E0BAQF67bPz45hiLw/company-logo_100_100/company-logo_100_100/0/1696813943410/forbes_magazine_logo?e=1794441600&v=beta&t=9i-vla1ZdIxafP-9ip-sbQeQum_xDsmjntmncFUDwuw"
      },
      "snippet": "From a coffee shop idea to a $20 million-plus entertainment business, Ghost City Tours founder Tim Nealon has expanded h…",
      "image": "https://media.licdn.com/dms/image/v2/D5610AQEO3gWmyejm_A/videocover-high/B56aFlNJyNHUAo-/0/1792699317329?e=2147483647&v=beta&t=vCIY-JMBIcY5VfiQCGVIFhjeDpOC6qSoeKy0YCXIVQE",
      "headline": "How I Went From Concept To Cash Flow In 72 Hours",
      "details_link": "https://www.linkedin.com/ad-library/detail/1592708583"
    },
    {
      "position": 3,
      "ad_id": "1611345964",
      "format": "single_image",
      "advertiser": {
        "name": "Dash Social",
        "thumbnail": "https://media.licdn.com/dms/image/v2/D560BAQHsLPSLEhWYbw/company-logo_100_100/company-logo_100_100/0/1736895999755/dash_hudson_logo?e=1794441600&v=beta&t=M7ipYg6M5-P94x4XPUgW-jOPcCJIrtYenShav0Gk2n4"
      },
      "snippet": "Social listening shouldn’t feel like an archaeology dig.\n\nDash tracks trending keywords with sentiment and uses Vision A…",
      "image": "https://media.licdn.com/dms/image/v2/D4E10AQHwttMHVuggTQ/image-shrink_1280/B4EaFk.NygJsAc-/0/1792695393686/SL-BOFU-2-1x1jpg?e=2147483647&v=beta&t=wg3jrjHcwYvVCngpKX_NWVLLi9U0x38NTRL-BEE_fWk",
      "headline": "Let AI spot the trends for you",
      "details_link": "https://www.linkedin.com/ad-library/detail/1611345964"
    },
    ...
  ],
  "serpapi_pagination": {
    "next_page_token": "1611345954-1792696696974",
    "next": "https://serpapi.com/search.json?engine=linkedin_ad_library&next_page_token=1611345954-1792696696974&q=Coffee"
  }
}

Example with q: Coffee and next_page_token: 1611345954-1792696696974

LinkedIn Ad Library returns up to 24 ads per page. To get the next page, like with the Show more button, set next_page_token to the serpapi_pagination.next_page_token of the previous page and keep the other parameters, or follow the serpapi_pagination.next link. search_information.total_results is only returned on the first page, and the last page has no serpapi_pagination.

Example with q: Coffee and next_page_token: 1611345954-1792696696974

JSON Example

{
  ...
  "search_parameters": {
    "engine": "linkedin_ad_library",
    "q": "Coffee",
    "next_page_token": "1611345954-1792696696974"
  },
  "ads": [
    {
      "position": 1,
      "ad_id": "1611403774",
      "format": "single_image",
      "advertiser": {
        "name": "Ben Brandon, CSP",
        "headline": "Talent Solutions Leader | Helping Companies Scale Teams Across Accounting, IT, HR & Marketing | Project Solutions for Complex Hiring | AccruePartners",
        "thumbnail": "https://media.licdn.com/dms/image/v2/D4E03AQFWbAg2TrPeNw/profile-displayphoto-scale_100_100/B4EZ8Tb.P0JMAc-/0/1782737530700?e=1794441600&v=beta&t=OB0t107NbvmNIeN0WOIpFEeiJx3TEJXLobfsSRFzGeM"
      },
      "snippet": "Over the last six months, we’ve met with hundreds of business leaders across the Carolinas, from the C-suite to the fron…",
      "details_link": "https://www.linkedin.com/ad-library/detail/1611403774"
    },
    {
      "position": 2,
      "ad_id": "1611395104",
      "format": "single_image",
      "advertiser": {
        "name": "Luis Fernando Esponda",
        "headline": "Expansión | Ventas | Retail | Regional CSO at @TheCoffee.jp | Grab and go. Simple.",
        "thumbnail": "https://media.licdn.com/dms/image/v2/D4E03AQHACbeFnmnwNw/profile-displayphoto-scale_100_100/B4EZnl3ed8KkAc-/0/1760498149973?e=1794441600&v=beta&t=bqe-JfHXU99rDE2vRurpVOP0m1R8Ey-NyQEjg_8K2_o"
      },
      "snippet": "¿Te gustaría tener tu propio The Coffee?\n\nEl consumo de café en México creció más de 23% en los últimos años, impulsado …",
      "carousel_cards": [
        {
          "image": "https://media.licdn.com/dms/image/v2/D4E22AQHlFWItiDgogw/feedshare-shrink_1280/B4EZqpSGjWJ0As-/0/1763776687168?e=1794441600&v=beta&t=-SFa_BHHGdEsk9BVhG2dbTKDVyB97WQZ9V0rp2c5P78"
        },
        {
          "image": "https://media.licdn.com/dms/image/v2/D4E22AQFWUXMxGwIa1Q/feedshare-shrink_1280/B4EZqpSGjnIoAs-/0/1763776687328?e=1794441600&v=beta&t=nPxjhRVCrWPAdgkwGUXxY0sNXcIPFhrB-lZggPWImWg"
        }
      ],
      "details_link": "https://www.linkedin.com/ad-library/detail/1611395104"
    },
    ...
  ],
  "serpapi_pagination": {
    "next_page_token": "1656712336-1792687924133",
    "next": "https://serpapi.com/search.json?engine=linkedin_ad_library&next_page_token=1656712336-1792687924133&q=Coffee"
  }
}

JSON structure overview

{
  ...
  "search_information": {
    "total_results": "Integer - Number of ads that match the search (only returned on the first page)",
    "ads_state": "String - `Fully empty` when LinkedIn Ad Library returns no ads"
  },
  "ads": [
    // please refer to Ads page for the detailed structure
  ],
  "serpapi_pagination": {
    "next_page_token": "String - Token to get the next page of ads with the `next_page_token` parameter",
    "next": "String - SerpApi link to the next page of ads"
  }
}