Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APILinkedIn Ad Library

    linkedin_ads.ad

    One ad in the LinkedIn Ad Library: the advertiser, who paid, the whole text, link, buttons and media, and where the library states them the dates, impressions by country and targeting.

    Id
    linkedin_ads.ad
    Version
    1
    Billed per
    request — 1 unit for a charged run
    Runs
    within one request

    Start it with POST /v1/scrapers/linkedin_ads.ad/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.

    Inputs

    The fields of input. A field that is not listed here is refused.

    Inputs of linkedin_ads.ad
    FieldTypeDescription
    adrequiredstringThe ad's id (ad_id in this family's records), or its address in the library: https://www.linkedin.com/ad-library/detail/1690169656.Limit: at least 6 characters, at most 300 characters.
    • ad is the ad's id, ad_id in this family's records, or its address in the library (https://www.linkedin.com/ad-library/detail/…).
    • The dates, impressions, impressions_by_country and targeting are stated by the library for ads shown in the European Union; for other ads they are null or empty.
    • An id the library has no ad for ends the run failed with not_found, and costs nothing — see the reasons of this family.

    Record fields

    Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.

    Record fields of linkedin_ads.ad
    FieldTypeNotes
    ad_idstringLinkedIn's id of the ad: the number in its address in the library.
    urlstringThe ad's page in the Ad Library.
    advertiser_namestring or nullThe organisation that runs the ad.
    advertiser_urlstring or nullThe advertiser's page on LinkedIn.
    advertiser_logostring or nullThe advertiser's logo.
    paid_for_bystring or nullWho paid for the ad, as the library states it.
    formatstring or nullThe kind of ad, as the library names it, e.g. Single Image Ad, Video Ad, Carousel Ad, Document Ad, Message Ad.
    creative_typestring or nullLinkedIn's own code for the kind of ad, e.g. SPONSORED_STATUS_UPDATE.
    textstring or nullThe ad's whole text. A message ad shows its placeholders, e.g. %FIRSTNAME%.
    headlinestring or nullThe headline under the image or video.
    link_urlstring or nullWhere the ad leads, when the page links it.
    buttonsarray of stringThe labels of the ad's buttons, e.g. Learn more.
    imagesarray of stringThe ad's images.
    videostring or nullThe ad's video file, in the best quality the page offers.
    video_preview_imagestring or nullThe still shown before the video plays.
    document_pagesarray of stringThe preview pages of a document ad, as images.
    slidesarray of objectThe slides of a carousel ad, in order, each with where it leads.
    title (in slides[])string or nullThe slide's caption.
    image (in slides[])string or nullThe slide's image.
    link_url (in slides[])string or nullWhere the slide leads. Given on the ad's own page (linkedin_ads.ad), not in search results.
    event_timestring or nullWhen an event ad's event takes place, as the library writes it.
    ran_fromstring (date) or nullThe first day the ad ran. The library states it for ads shown in the European Union.
    ran_tostring (date) or nullThe last day the ad ran, as far as the library states it.
    impressionsstring or nullThe ad's total impressions, as the range the library shows, e.g. 5k-10k or <1k. Stated for ads shown in the European Union.
    impressions_by_countryarray of objectThe share of the impressions by country, where the library states it.
    country (in impressions_by_country[])stringThe country, by its English name.
    share (in impressions_by_country[])stringThe share of the ad's impressions in that country, as the library writes it, e.g. 56%.
    targetingarray of objectThe targeting the advertiser chose, where the library states it: language and location in words, and for each other parameter whether people were included or excluded by it.
    parameter (in targeting[])stringWhat the advertiser targeted by, as the library names it: Language, Location, Audience, Demographic, Company, Education, Job, Member Interests and Traits.
    value (in targeting[])string or nullWhat the library says was chosen, for language and location, e.g. Targeting includes Germany, Switzerland and Austria.
    targeted (in targeting[])boolean or nullWhether the advertiser included people by this parameter. Null for language and location, which are described in value.
    excluded (in targeting[])boolean or nullWhether the advertiser excluded people by this parameter.
    fetched_atstring (date-time)When the page was read, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    curl -X POST "https://api.enrichednow.com/v1/scrapers/linkedin_ads.ad/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"ad":"1643762774"}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("linkedin_ads.ad", {"ad": "1643762774"})
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("linkedin_ads.ad", { ad: "1643762774" });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "linkedin_ads.ad", map[string]any{"ad": "1643762774"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("linkedin_ads.ad", Map.of("ad", "1643762774"));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run linkedin_ads.ad --input-json '{"ad":"1643762774"}'

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "input": {
        "ad": "1643762774"
      }
    }

    Example response

    The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.

    JSON
    {
      "id": "run_841742f37553189ff9c27ba1",
      "scraper_id": "linkedin_ads.ad",
      "scraper_version": 1,
      "status": "ok",
      "reason": null,
      "input": {
        "ad": "1643762774"
      },
      "record_count": 1,
      "units": 1,
      "units_per_request": 1,
      "units_per_record": null,
      "units_per_page": null,
      "diagnostics": {
        "requests": 1,
        "bytes": 259214,
        "wall_ms": 885,
        "facts": {}
      },
      "created_at": "2026-11-16T22:37:50.170950Z",
      "started_at": "2026-11-16T22:37:50.178331Z",
      "finished_at": "2026-11-16T22:37:51.066313Z"
    }

    Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.

    JSON
    {
      "records": [
        {
          "ad_id": "1643762774",
          "url": "https://www.linkedin.com/ad-library/detail/1643762774",
          "advertiser_name": "Adobe for Business",
          "advertiser_url": "https://www.linkedin.com/company/3509272",
          "advertiser_logo": "https://media.licdn.com/dms/image/v2/C560BAQH7EdXSnwaEaA/company-logo_100_100/company-logo_100_100/0/1630616475439/adobe_experience_cloud_logo?e=1796860800&v=beta&t=0wtsSuVr_vAm6bFEMR_Vf7vq0tsPPrN15IJBLlcFri8",
          "paid_for_by": "ADOBE SYSTEMS SOFTWARE IRELAND LIMITED",
          "format": "Carousel Ad",
          "creative_type": "SPONSORED_UPDATE_CAROUSEL",
          "text": "Pendant les milliers d’interactions des moments forts des matchs, Adobe permet au Real Madrid d’offrir des expériences ciblées.",
          "headline": null,
          "link_url": null,
          "buttons": [],
          "images": [],
          "video": null,
          "video_preview_image": null,
          "document_pages": [],
          "slides": [
            {
              "title": "Agissez au moment où cela compte vraiment",
              "image": "https://media.licdn.com/dms/image/v2/D4E10AQHyyEF_qZ7_tg/image-shrink_1080_1080/B4EaEhSA1_J0Ao-/0/1791559732877?e=1795651200&v=beta&t=fY_U2-GBpkwLREwH2_GBYLxV50mldQiIf9eX9whE-GU",
              "link_url": "https://business.adobe.com/fr/customer-success-stories/real-madrid.html?sdid=L3XTTG36&mv=social&mv2=paidsoc"
            },
            {
              "title": "Des réactions aux actions",
              "image": "https://media.licdn.com/dms/image/v2/D4E10AQFRAyHVx7fUHQ/image-shrink_1280/B4EaHah_toIgAI-/0/1794667707458?e=1795651200&v=beta&t=lPuDU6WsshWcJmvrP-MmdWSicF7ZQXjdzyJbIysaHd0",
              "link_url": "https://business.adobe.com/fr/customer-success-stories/real-madrid.html?sdid=L7NVTBC5&mv=social&mv2=paidsoc"
            }
          ],
          "event_time": null,
          "ran_from": "2026-11-15",
          "ran_to": "2026-11-18",
          "impressions": "<1k",
          "impressions_by_country": [
            {
              "country": "France",
              "share": "100%"
            }
          ],
          "targeting": [
            {
              "parameter": "Language",
              "value": "Targeting includes Français",
              "targeted": null,
              "excluded": null
            },
            {
              "parameter": "Location",
              "value": "Targeting includes France",
              "targeted": null,
              "excluded": null
            }
          ],
          "fetched_at": "2026-11-19T18:07:40.924244Z"
        }
      ],
      "next_cursor": null
    }

    What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].

    • Shortened: slides: 6 items, the first 2 shown.
    • Shortened: targeting: 8 items, the first 2 shown.

    A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the LinkedIn Ad Library scrapers are in their own section there.