LinkedIn Ad Library API — Download Ad Video & Images
Documentation menu
FetchLayer FetchLayer API

Get an ad's videos and images

Resolve a LinkedIn ad's creative into downloadable asset URLs — videos, images and thumbnails, across the main creative and every attachment. LinkedIn's own CDN URLs are signed and expire, so each asset also carries a stable download URL served through this API. Optionally probe each asset to confirm it is still available, or return small assets base64-encoded inline.

POST /ad-media Media
https://api.fetchlayer.dev/linkedin-ad-library/ad-media
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

ad string required

Ad id, or an Ad Library URL containing one.

kinds string[] optional

video, image, and/or thumbnail. (default: all three)

preferHighQuality boolean optional

Pick the largest video rendition. (default: true)

probe boolean optional

Confirm each asset is still downloadable and report its size and content type.

inline boolean optional

Return the bytes base64-encoded. Refused for assets over the inline size limit.

Response Fields

ad-media

Get an ad's videos and images

adId string

The resolved ad id.

assets object[]

The ad’s media assets.

assets[].kind string

video, image, or thumbnail.

assets[].url string

LinkedIn’s own CDN URL. Signed, and expires.

assets[].downloadUrl string

Serves the same file through FetchLayer, without the expiry — pass it to GET /media.

assets[].quality string

hd, sd, original, or preview.

assets[].label string

Video rendition name, e.g. "mp4-720p-30fp-crf28".

assets[].bitrate number

Bits per second, for a video asset.

assets[].attachmentIndex number

Which attachment this asset belongs to, or null for the main creative.

assets[].contentType string

MIME type. Populated when probe or inline was set.

assets[].contentLength number

Size in bytes. Populated when probe or inline was set.

assets[].base64 string

The bytes themselves. Populated only when inline was set.

assetCount number

Number of assets in this response.

notes string[]

Caveats about this particular result, such as an asset that could not be probed.

Request

curl -X POST "https://api.fetchlayer.dev/linkedin-ad-library/ad-media" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"ad":"512345678","kinds":["video","image"],"preferHighQuality":true,"probe":true}'

Response

{
  "adId": "512345678",
  "assetCount": 2,
  "notes": [],
  "assets": [
    {
      "kind": "video",
      "quality": "hd",
      "label": "mp4-720p-30fp-crf28",
      "bitrate": 1284000,
      "contentType": "video/mp4",
      "contentLength": 4182773
    }
  ]
}