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

Get an ad's videos and images

Resolve an ad's creative files into downloadable asset URLs — videos, images and thumbnails, at high quality or watermarked, across every creative variation. Optionally probe each asset to confirm it is still available and report its size and content type.

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

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

ad string required

Ad archive id, or an Ad Library URL containing one.

country string optional

Two-letter country code, or ALL.

kinds string[] optional

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

preferHighQuality boolean optional

Pick HD video and original images. (default: true)

watermarked boolean optional

Prefer Facebook's watermarked copies.

includeVariations boolean optional

Include media from every creative version of the ad.

probe boolean optional

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

Response Fields

ad-media

Get an ad's videos and images

assets object[]

The ad’s media assets.

assets[].kind string

video, image, or thumbnail.

assets[].url string

Original Facebook or Instagram CDN URL.

assets[].downloadUrl string

FetchLayer download URL — pass it to GET /media to stream the bytes.

assets[].quality string

Which rendition was picked.

assets[].contentType string

MIME type, when probed.

assets[].contentLength number

Size in bytes, when probed.

assetCount number

Number of assets in this response.

Request

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

Response

{
  "assetCount": 2,
  "assets": [
    {
      "kind": "video",
      "quality": "hd",
      "contentType": "video/mp4",
      "contentLength": 4182773,
      "url": "https://video.xx.fbcdn.net/..."
    }
  ]
}