Competitor research
How to Spy on Competitor Facebook Ads (Legally, with Data)
Every ad your competitors run on Facebook and Instagram is public in the Meta Ad Library. "Spying" on them is not about tricks: it is about reading that public record systematically, so you know which offers they push, which hooks they test and which creatives they keep paying for. This guide shows the method, and the API calls that turn it from an afternoon of scrolling into a repeatable process.
Published 6 min read
On this page
What you can learn from a competitor's ads
An ad is the most honest document a company publishes. A landing page says what a brand wants to be; the ads it keeps paying for say what actually sells. From the Ad Library you can read, for every active ad of a competitor:
- The offer. Discounts, free shipping, trials, bundles, guarantees: the
bodyandtitleof the ad and thelink_descriptionunder the link. - The hook. The first line of the text and the first seconds of the video are where advertisers test the most. Ten ads with the same product and ten different opening lines tell you which angles they are exploring.
- The funnel. The
link_urlshows where the traffic goes: a product page, a quiz, a lead form, an app store. Thecta(text and type) shows what they ask for: "Shop now", "Sign up", "Install now". - The format mix.
formatsays image, video, carousel, or dynamic (dco,dpa). A competitor moving budget from images to video is a signal. - The testing effort.
variants_countcounts the ads sharing the same creative. A creative running in 12 variants is one the advertiser is actively scaling. - The age of each ad.
started_atand the deriveddays_active. Advertisers switch off what loses money, so an ad running for months is very likely profitable. - Where it runs.
platforms(Facebook, Instagram, Messenger, Threads, Audience Network) and, when Meta exposes it,countries.
None of this is hidden or obtained through an account: it is exactly what the Ad Library shows any visitor. What changes with an API is scale and memory. You can read every ad of ten competitors in minutes and keep the data, so next month you can see what changed.
Step 1: find who your competitors really are
You probably know your three main rivals. The Ad Library usually reveals more: smaller brands, resellers and affiliates bidding on the same audience. The advertiser search endpoint returns the advertisers that ran ads matching a keyword, deduplicated by page, with their page id, categories, likes and ads_in_results, the number of matching ads seen for that page.
curl -s "https://api.scrapeadlibrary.com/v1/pages/search?q=protein%20powder&country=US&limit=10" \
-H "X-API-Key: $SCRAPEADLIBRARY_API_KEY"Run it for each of your core keywords (the product category, the main benefit, the problem you solve) and in each country you sell to. Each call returns up to 10 advertisers and costs one credit. Keep the page ids: they are the stable handle for everything that follows. If you would rather look first, the free Ad Library search shows the same advertisers in the browser, and the search tips explain how to find a page id from a URL.
Step 2: pull every active ad of each competitor
With a page id, the page ads endpoint lists the ads of that advertiser, up to 30 per call, with the same filters as a search (country, status, media type, platforms, dates). Asking for sort=impressions puts the ads Meta ranks as most seen first, which is where the budget is. This script collects the active ads of a list of competitors and prints a one-line summary of each:
import os
import requests
API = "https://api.scrapeadlibrary.com"
HEADERS = {"X-API-Key": os.environ["SCRAPEADLIBRARY_API_KEY"]}
COMPETITORS = ["15087023444", "115939511520844"] # page ids from step 1
for page_id in COMPETITORS:
result = requests.get(
f"{API}/v1/pages/{page_id}/ads",
params={"country": "US", "status": "active", "sort": "impressions"},
headers=HEADERS,
timeout=60,
).json()
print(f"== {page_id}: {result['total_estimate']} active ads (estimate)")
for ad in result["data"]:
hook = (ad["body"] or "").split("\n")[0][:80]
print(ad["format"], ad["variants_count"], ad["days_active"], ad["link_url"], "|", hook)A large advertiser can have thousands of active ads; follow next_cursor for more pages (one credit each) or narrow with media_type, platforms or languages. For most research, the first one or two pages sorted by impressions already show the creatives that matter.
Step 3: read the ads like an analyst
Raw ads are noise until you group them. Four views give most of the insight:
- Group by landing page. Count ads per
link_urldomain and path. The pages with the most ads are the products or offers the competitor is pushing hardest this month. - Group by creative. Ads that share a
collation_idare variants of the same creative. Sort creatives byvariants_countanddays_active: a creative that is both old and heavily varied is a proven winner being scaled. - List the hooks. Take the first sentence of every
body. Read them in one column and the angles become obvious: price, speed, social proof, fear of missing out, a founder story. - Look at what stopped. Ask again with
status=inactiveand a recentactive_fromwindow: ads that ran for a few days and stopped are the tests that lost. Knowing what failed is as valuable as knowing what works.
The winning ads guide explains the winning_score the API computes from longevity, variants and EU reach, which is a quick way to rank hundreds of ads before reading them.
Go deeper on a single ad
When an ad looks important, fetch its detail. For ads delivered in the EU you get the transparency data the Digital Services Act requires: estimated EU reach, the targeted age range, gender and locations, and a reach breakdown by country, age and gender. That tells you not only what a competitor says but to whom.
{
"data": {
"id": "1550534860016399",
"status": "active",
"variants_count": 6,
"days_active": 94,
"payers": [{ "payer": "Example Nutrition Ltd", "beneficiary": "Example Nutrition Ltd" }],
"transparency": {
"eu": { "reach": 65104, "gender": "all", "age_min": 25, "age_max": 54,
"locations": [{ "name": "Germany", "type": "country", "excluded": false }],
"breakdown": [{ "country": "DE", "age_range": "25-34", "male": 18210, "female": 9120, "unknown": 40 }] },
"uk": null
}
},
"credits_used": 1,
"cached": false
}The EU transparency guide explains every field and its limits.
Step 4: look beyond Meta
Competitors rarely advertise on one network only. The same API key reads two other public ad libraries: the Google Ads Transparency Center (Search, YouTube and Display ads, searchable by the website the ads point to) and the LinkedIn Ad Library (B2B ads by company name). Each call is one credit, as on Meta.
# Google ads pointing to a competitor's website, shown in the US
curl -s "https://api.scrapeadlibrary.com/v1/google/ads/search?domain=example.com®ion=US" -H "X-API-Key: $SCRAPEADLIBRARY_API_KEY"
# LinkedIn ads of a company, shown in Germany
curl -s "https://api.scrapeadlibrary.com/v1/linkedin/ads/search?advertiser=HubSpot&country=DE" -H "X-API-Key: $SCRAPEADLIBRARY_API_KEY"Make it a habit, not a one-off
The value of competitor research compounds. A snapshot tells you what a rival does today; a snapshot every day tells you when they launch, what they kill and how long their winners last. The tracking guide builds that daily job in about forty lines. Agencies doing this for several clients will find templates for audits and weekly reports in Facebook ad research for agencies.
| Question | Call | Credits |
|---|---|---|
| Who advertises on my keyword? | GET /v1/pages/search?q= | 1 per call |
| What does this competitor run? | GET /v1/pages/{page_id}/ads | 1 per page of results |
| Who sees this ad in the EU? | GET /v1/ads/{ad_id} | 1 |
| Do they advertise on Google too? | GET /v1/google/ads/search?domain= | 1 per page of results |
Stay on the right side of the line
Reading public ads is legitimate market research, and the transparency rules exist precisely so that competitors, researchers and journalists can scrutinise advertising. Copying a competitor's creative or text word for word is a different matter: creatives are copyrighted works and brands are trademarks. Use what you learn to understand the market and sharpen your own angles. The legal guide covers the rules in more detail.
Frequently asked questions
- Will a competitor know I am looking at their ads?
- No. The Ad Library is public and read logged out; neither Meta nor the advertiser is told who looked at an ad.
- Can I see how much a competitor spends on Facebook ads?
- Not for commercial ads: Meta publishes spend only for political and issue ads. You can estimate relative effort from the number of active ads, variants, longevity and EU reach, as the ad spend guide explains.
- How do I find a competitor's page id?
- Search the brand or your keyword with the advertiser search endpoint: every result carries its page id. In the Ad Library itself, the id is the view_all_page_id value in the URL of an advertiser's page.
- Does this include Instagram ads?
- Yes. Meta's Ad Library covers Facebook, Instagram, Messenger, Threads and the Audience Network, and every ad lists the platforms it runs on.
Related guides
- How to Track Competitor Facebook Ads AutomaticallyBuild a daily job that snapshots competitors' Facebook ads, detects new launches and stopped ads by ad id, and measures how long each ad runs.
- How to Find Winning Facebook Ads for DropshippingUse ad longevity to find winning Facebook ads for dropshipping: days_active, a 0-100 winning_score, and code that ranks the ads of any product niche.
- How to See a Competitor's Facebook Ad Spend (What Is Really Public)What Meta really publishes about Facebook ad spend: ranges for political ads, and for commercial ads the signals that show how hard a rival is pushing.