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.
| Field | Type | Description |
|---|---|---|
adrequired | string | The 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. |
adis the ad's id,ad_idin this family's records, or its address in the library (https://www.linkedin.com/ad-library/detail/…).- The dates,
impressions,impressions_by_countryandtargetingare stated by the library for ads shown in the European Union; for other ads they arenullor empty. - An id the library has no ad for ends the run
failedwithnot_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.
| Field | Type | Notes |
|---|---|---|
ad_id | string | LinkedIn's id of the ad: the number in its address in the library. |
url | string | The ad's page in the Ad Library. |
advertiser_name | string or null | The organisation that runs the ad. |
advertiser_url | string or null | The advertiser's page on LinkedIn. |
advertiser_logo | string or null | The advertiser's logo. |
paid_for_by | string or null | Who paid for the ad, as the library states it. |
format | string or null | The kind of ad, as the library names it, e.g. Single Image Ad, Video Ad, Carousel Ad, Document Ad, Message Ad. |
creative_type | string or null | LinkedIn's own code for the kind of ad, e.g. SPONSORED_STATUS_UPDATE. |
text | string or null | The ad's whole text. A message ad shows its placeholders, e.g. %FIRSTNAME%. |
headline | string or null | The headline under the image or video. |
link_url | string or null | Where the ad leads, when the page links it. |
buttons | array of string | The labels of the ad's buttons, e.g. Learn more. |
images | array of string | The ad's images. |
video | string or null | The ad's video file, in the best quality the page offers. |
video_preview_image | string or null | The still shown before the video plays. |
document_pages | array of string | The preview pages of a document ad, as images. |
slides | array of object | The slides of a carousel ad, in order, each with where it leads. |
title (in slides[]) | string or null | The slide's caption. |
image (in slides[]) | string or null | The slide's image. |
link_url (in slides[]) | string or null | Where the slide leads. Given on the ad's own page (linkedin_ads.ad), not in search results. |
event_time | string or null | When an event ad's event takes place, as the library writes it. |
ran_from | string (date) or null | The first day the ad ran. The library states it for ads shown in the European Union. |
ran_to | string (date) or null | The last day the ad ran, as far as the library states it. |
impressions | string or null | The 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_country | array of object | The share of the impressions by country, where the library states it. |
country (in impressions_by_country[]) | string | The country, by its English name. |
share (in impressions_by_country[]) | string | The share of the ad's impressions in that country, as the library writes it, e.g. 56%. |
targeting | array of object | The 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[]) | string | What 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 null | What the library says was chosen, for language and location, e.g. Targeting includes Germany, Switzerland and Austria. |
targeted (in targeting[]) | boolean or null | Whether the advertiser included people by this parameter. Null for language and location, which are described in value. |
excluded (in targeting[]) | boolean or null | Whether the advertiser excluded people by this parameter. |
fetched_at | string (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:
{
"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.
{
"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.
{
"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.