100 free credits. No credit card required. Get a key

LinkedIn ad details API

One ad from LinkedIn’s Ad Library: format, advertiser, who paid, run dates, total impressions and impressions by country, targeting, and the creative’s text, headline, link and images.

GET /v1/linkedin/ads/{ad}Beta5 credits per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/linkedin/ads/1695641666",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 5 credits
{
"ad_id": "1695641666",
"url": "https://www.linkedin.com/ad-library/detail/1695641666",
"creative_type": "SPONSORED_STATUS_UPDATE",
"format": "Single Image Ad",
"advertiser": {
"name": "Microsoft",
"url": "https://www.linkedin.com/company/1035",
"company_id": "1035"
},
"paid_by": "Test Company",
"ran_from": null,
"ran_to": null,
"run_text": null,
"commentary": "Want to explore what's new from #MSIgnite? 🔎 Discover the latest announcements and how to put them into action. 👉 Micros…",
"headline": "A vibrant event entrance featuring the text 'Microsoft Ignite | Frontier unlocked.' Colorful abstract lines in green, re…",
"destination_url": null,
"cta": null,
"image_urls": [
"https://media.licdn.com/dms/image/v2/D4E10AQGtdcbCDNpRSA/image-shrink_1280/B4EaH1Te92JUAY-/0/1795116888255?e=2147483647&…"
],
"video_url": null,
"total_impressions": null,
"impressions_by_country": [],
"targeting": [],
"targeting_parameters": []
}

Parameters

NameTypeDescription
adpath · requiredstringThe ad id or its URL (linkedin.com/ad-library/detail/<id>). Example: 1695641666.
Response fields

200 with a LinkedInAd, in LinkedIn’s own schema.org JSON-LD, with the rest of the public page beside it.

FieldTypeDescription
ad_idstring
urlstring
creative_typestring | null
formatstring | null
advertiserobject
paid_bystring | null
ran_fromstring | nullYYYY-MM-DD.
ran_tostring | nullYYYY-MM-DD; null while it is still running.
run_textstring | null
commentarystring | null
headlinestring | null
destination_urlstring | null
ctastring | null
image_urlsstring[]
video_urlstring | null
total_impressionsstring | nullA range, e.g. "5k-10k".
impressions_by_countryobject[]
targetingobject[]
targeting_parametersobject[]
Status codes
StatusMeaning
200The ad.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404LinkedIn has no such public page, or it was removed.
429Too many requests. Wait for Retry-After seconds.
503LinkedIn is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

What if the ad does not exist?

A missing, removed or hidden page answers an error (404 target_not_found, or 503 upstream_unavailable when LinkedIn turned every visit away) and is never charged.

LinkedIn is a trademark of LinkedIn Corporation. We are not affiliated with or endorsed by LinkedIn.