Accepts links copied from the Meta Ad Library, Google Ads Transparency Center, TikTok Ad Library, LinkedIn Ad Library, Pinterest Ads Repository or an X post, and returns the ad or advertiser id with the endpoint that fetches it.
API reference · Ads
Turn an ad library link into AdLib ids
GET
/v1/library-urlfreeExample request
curl "https://api.adlibapi.com/v1/library-url?url=https%3A%2F%2Fwww.facebook.com%2Fads%2Flibrary%2F%3Fid%3D1187430977361020" \
-H "X-API-Key: $ADLIB_API_KEY"Send your key in the X-API-Key header. Try it in the explorer.
Parameters
urlrequiredstring
A link copied from an ad library
e.g. https://www.facebook.com/ads/library/?id=1187430977361020
Response
data.hrefrequiredstring
The AdLib call that fetches it
data.idrequiredstring
<platform>:<id>, usable in every endpoint
data.kindrequiredstring
One of ad, advertiser
data.platformrequiredstring
–