1. Platforms
  2. LinkedIn Scraper API
  3. LinkedIn Ad Library ad details API

LinkedIn Ad Library ad details API

LinkedIn Ad Library ad details, as JSON, with id, url, advertiser, status, started_at and more.

GET api.socialscrape.dev/v1/linkedin/ad-library/ad

Cost
1 credit
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits

You send one of url or id.

Part of the LinkedIn Scraper API: 8 LinkedIn endpoints on one key.

Request

Send your key in the x-api-key header.

1curl -G "https://api.socialscrape.dev/v1/linkedin/ad-library/ad" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode 'id=1662766106'

Parameters

NameTypeRequiredDescription
urlurlone ofAd URL (linkedin.com/ad-library/detail/...).
idstringone ofAd id in the library. Also accepted as ad_id, adId.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are examples, not your data.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_0d0502c11822062d20778ec8",8  "data": {9    "object": "ad",10    "platform": "linkedin",11    "id": "1662766106",12    "url": "https://www.linkedin.com/ad-library/detail/1662766106",13    "advertiser": {14      "object": "advertiser",15      "platform": "linkedin",16      "id": "3634496",17      "name": "Microsoft AI Cloud Partner Program",18      "url": "https://www.linkedin.com/company/3634496",19      "page_id": null,20      "country": null,21      "verified": null,22      "ad_count": null,23      "extra": null24    },25    "status": "unknown",26    "started_at": null,27    "ended_at": null,28    "title": "Make each Microsoft 365 Business Premium opportunity a security conversation",29    "body": "Every Microsoft 365 Business Premium opportunity can open a broader security conversation.\n\nIn his latest blog, Diego Bekerman shares how partners can connec...",30    "cta_text": null,31    "landing_url": null,32    "format": null,33    "media": {34      "thumbnail_url": null,35      "video_url": null,36      "audio_url": null,37      "image_urls": [38        "https://media.licdn.com/dms/image/v2/D4E10AQHgdQBe1y_lsQ/image-shrink_1280/B4EaF.aXC_HwAc-/0/1793122202032?e=2147483647&v=beta&t=lILQREka0rK8ccXqihFXhxDtktZk..."39      ],40      "width": null,41      "height": null42    },43    "regions": null,44    "publisher_platforms": null,45    "impressions": null,46    "spend": null,47    "extra": {48      "advertiser_logo_url": "https://media.licdn.com/dms/image/v2/C560BAQF-MwAnNIx7lQ/company-logo_100_100/company-logo_100_100/0/1630621036154/microsoft_partner_network_logo?e=179504640...",49      "creative_type": "SPONSORED_STATUS_UPDATE",50      "paid_for_by": "Vnc Communications, Inc."51    }52  },53  "cursor": null,54  "has_more": null55}

Fields

One Ad in data.

A field the platform does not give is null, never made up. Extra platform details are in extra.

FieldTypeAlwaysNotes
object"ad"
platformPlatformyesthe ad library's platform
idstringyes
urlstring or null
advertiserAdvertiser or null
status"active" or "inactive" or "unknown"
started_atstring (ISO 8601 date-time) or null
ended_atstring (ISO 8601 date-time) or null
titlestring or null
bodystring or null
cta_textstring or null
landing_urlstring or null
formatstring or null"image" | "video" | "carousel" | "text" | platform-specific
mediaMedia
Show the other 5 fields
FieldTypeAlwaysNotes
regionsstring[] or null
publisher_platformsstring[] or nullwhere it ran: facebook, instagram, ...
impressionsRange or null
spendRange or null
extraobject or null

Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.

Questions

Which errors can it return?

invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.

Is there an SDK call for it?

The Python client has client.linkedin.ad_library_ad(...) and the TypeScript client client.linkedin.adLibraryAd(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.

Can an AI agent call it?

Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.