Facebook Ad Library API — Parse an Ad Library URL
Documentation menu
FetchLayer FetchLayer API

Parse an Ad Library URL

Turn any Facebook Ad Library URL into the structured filters it encodes — whether it points at one ad, an advertiser, or a search, plus the country, status, media type, platform and date filters carried in its query string. Parsing a URL does not consume a credit.

POST /resolve-url Utility
https://api.fetchlayer.dev/facebook-ad-library/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Any Ad Library URL, to be parsed into structured filters.

Response Fields

resolve-url

Parse an Ad Library URL

kind string

What the URL points at: ad, advertiser, search, or unknown.

adArchiveId string

Present when kind is ad.

pageId string

Present when kind is advertiser.

query string

Present when kind is search.

country string

Country filter carried in the URL.

activeStatus string

Status filter carried in the URL.

publisherPlatforms string[]

Platform filters carried in the URL.

Request

curl -X POST "https://api.fetchlayer.dev/facebook-ad-library/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=crm"}'

Response

{
  "kind": "search",
  "query": "crm",
  "country": "US",
  "activeStatus": "active",
  "publisherPlatforms": []
}