1. Use cases
  2. Ad research from ad libraries

Ad research from ad libraries

Find a company's running ads across ad libraries.

The job

Each ad library has its own search. Find the advertiser, list its ads, and transcribe the video ones to read the script.

Endpoints

Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.

EndpointReturnsCost
Facebook Ad Library advertiser search1 credit
Facebook Ad Library ads by page1 credit
Facebook Ad Library ad transcript1 credit
Google Ads Transparency ads by advertiser1 credit
LinkedIn Ad Library search1 credit
TikTok Ad Library search1 credit

Recipe

  1. Find the advertiser by name.
  2. List its ads, newest first.
  3. Transcribe the video ads.
1import os2import requests34API = "https://api.socialscrape.dev"5HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}678def get(path, **params):9    res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)10    res.raise_for_status()11    return res.json()["data"]1213# Facebook Ad Library advertiser search14found = get("/v1/facebook/ad-library/search/companies", query="Notion")15# Facebook Ad Library ads by page16ads = get("/v1/facebook/ad-library/company/ads", company_name="Notion", status="active", sort="newest")1718for ad in ads["items"][:10]:19    print(ad["url"])

Calls use api.socialscrape.dev and return the shapes in the reference.

Good to know

Libraries show what each platform chooses to publish. Meta and Google differ in what they disclose, so fields vary between libraries.

Related