LinkedIn Ad Library ad details API
LinkedIn Ad Library ad details, as JSON, with id, url, advertiser, status, started_at and more.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
You send one of url or id.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/linkedin/ad-library/ad" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'id=1662766106'import os
import requests
params = {
"id": "1662766106",
}
res = requests.get(
"https://api.socialscrape.io/v1/linkedin/ad-library/ad",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/linkedin/ad-library/ad");
url.search = new URLSearchParams({
id: "1662766106",
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape LinkedIn Ad Library ad details",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/linkedin/ad-library/ad",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "1662766106"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | url | one of | Ad URL (linkedin.com/ad-library/detail/...). |
id | string | one of | Ad 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 public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_0d0502c11822062d20778ec8",
"data": {
"object": "ad",
"platform": "linkedin",
"id": "1662766106",
"url": "https://www.linkedin.com/ad-library/detail/1662766106",
"advertiser": {
"object": "advertiser",
"platform": "linkedin",
"id": "3634496",
"name": "Microsoft AI Cloud Partner Program",
"url": "https://www.linkedin.com/company/3634496",
"page_id": null,
"country": null,
"verified": null,
"ad_count": null,
"extra": null
},
"status": "unknown",
"started_at": null,
"ended_at": null,
"title": "Make each Microsoft 365 Business Premium opportunity a security conversation",
"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...",
"cta_text": null,
"landing_url": null,
"format": null,
"media": {
"thumbnail_url": null,
"video_url": null,
"audio_url": null,
"image_urls": [
"https://media.licdn.com/dms/image/v2/D4E10AQHgdQBe1y_lsQ/image-shrink_1280/B4EaF.aXC_HwAc-/0/1793122202032?e=2147483647&v=beta&t=lILQREka0rK8ccXqihFXhxDtktZk..."
],
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": null,
"impressions": null,
"spend": null,
"extra": {
"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...",
"creative_type": "SPONSORED_STATUS_UPDATE",
"paid_for_by": "Vnc Communications, Inc."
}
},
"cursor": null,
"has_more": null
}Fields
One Ad in data.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "ad" | ||
platform | Platform | yes | the ad library's platform |
id | string | yes | |
url | string or null | ||
advertiser | Advertiser or null | ||
status | "active" or "inactive" or "unknown" | ||
started_at | string (ISO 8601 date-time) or null | ||
ended_at | string (ISO 8601 date-time) or null | ||
title | string or null | ||
body | string or null | ||
cta_text | string or null | ||
landing_url | string or null | ||
format | string or null | "image" | "video" | "carousel" | "text" | platform-specific | |
media | Media |
Show the other 5 fields
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 preview Python client has client.linkedin.ad_library_ad(...) and the TypeScript client client.linkedin.adLibraryAd(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.