Facebook Ad Library API — Getting Started — FetchLayer Docs
Documentation menu
FetchLayer FetchLayer API

Getting Started

Search the Facebook Ad Library in two steps, then follow an ad through to its creative files.

1. Get your API key

Create an account and generate a FetchLayer API key from your dashboard. No Meta developer account, app review, or access token is involved.

Create free account →

2. Search for ads

bash
curl -X POST https://api.fetchlayer.dev/facebook-ad-library/search-ads \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"project management software","country":"US","activeStatus":"active","limit":30}'

Tip

Already have an Ad Library URL? Send it to /resolve-url first — it parses the URL into the exact filters to pass here, and does not consume a credit.

3. Follow an ad to its creative

Every ad carries an adArchiveId. Pass it to /ad-media to resolve the video and image files, then stream the bytes from /media.

bash
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"],"probe":true}'

Tip

GET /media is the one endpoint that takes query parameters instead of a JSON body, and it supports HTTP Range requests — so a video streams and seeks in a player instead of downloading whole.

Next steps