The ad library shows the ads that Facebook pages run, but reading it one card at a time is slow, and nothing you see there can be sorted or saved. Scraping the library gives you a table of ads: who ran them, what they said, which button they used and how long they ran. That table is the starting point for most ad research, from a quick look at a category to a long-running swipe file. This guide uses Facebook Ads Scraper.
Step 1: Decide what to search
You can come at the library from two directions:
- By topic. Keywords like
running shoesormeal kitreturn ads from every advertiser that matches. Good for mapping a category. - By brand. A brand name like
nikereturns ads that mention it. To get everything one advertiser runs, see Step 5.
Add a country when the market matters. A two-letter code such as US, DE or GB limits the search to ads
that ran there.
Step 2: Choose Ad search
Open the tool on Apify. It has five modes; start with Ad search.
Open Facebook Ads Scraper (opens in a new tab)Step 3: Enter keywords, country and limit
| Field | Example | Notes |
|---|---|---|
| Keywords | nike | One per line. Each keyword is searched on its own. |
| Country | US | Optional. Empty means all countries. |
| Max items | 100 | The most ads per keyword. The default is 100. |
On Apify's free plan this tool returns up to 10 results per run, with up to 20 runs a day, which is enough to see what an ad row holds. The Store page shows the current price per 1,000 ads for full runs.
Step 4: Read an ad row
After the run, open Output. A row looks like this (shortened):
{
"type": "ad",
"id": "1702938977100376",
"advertiser": { "id": "15087023444", "name": "Nike" },
"text": "Bring sports more fully into your day with the Nike App.",
"ctaText": "Install now",
"landingUrl": null,
"startedAt": "2025-04-07T07:00:00Z",
"endedAt": "2026-11-10T08:00:00Z",
"isActive": true,
"media": [{ "kind": "image", "url": "https://scontent.fsac1-1.fna.fbcdn.net/..." }],
"url": "https://www.facebook.com/ads/library/?id=1702938977100376",
"input": { "keyword": "nike" }
}
What each part tells you:
advertiseris the page that ran the ad. Itsidis what the Company ads mode takes.textandctaTextare the copy and the button. Across a few hundred ads, the buttons alone show whether a category sells with "Shop now", "Learn more" or "Install now".startedAt,endedAtandisActivegive the run dates. An ad that has run for many months is usually one that works for the advertiser.landingUrlis the page the ad sends people to, when the library shows it.medialinks to the images or video.
Step 5: Go deeper on one advertiser
To list every ad of a single brand:
- Run Companies with the brand name. It returns advertiser pages with their ids.
- Run Company ads with those ids in Advertiser page ids.
For video ads, Ad transcript takes ad ids and returns the words spoken in the video. Putting five competitors' video scripts side by side is one of the fastest ways to see how they pitch the same product.
Step 6: Export and schedule
Click Export and download CSV or Excel for a sheet, or JSON to keep the media list intact. In
CSV, nested fields become columns like advertiser/name.
Ads change every week. Save your search as a task, add it to a schedule in Apify Console (weekly is
usually enough), and combine the datasets by ad id. Over a few months you can see which ads advertisers keep
and which they drop after a week.
Troubleshooting a search
Too many unrelated ads. A short keyword such as a common word matches a lot. Use a more specific phrase, add the country, or switch to the Companies and Company ads route for one brand.
No results for a country. Check that the code is two letters, like US or FR, not the country name.
Some categories simply run few ads in a small market; try again with Country empty to compare.
Missing landing pages. landingUrl is null when the library does not show one for that ad, as in the
example row. The ad's own url still opens it in the library.
An ad ended but still shows as active. The dates and flag reflect the library at the moment of the run.
Run the search again later for a fresh view, and compare by ad id.
Turning rows into findings
- Count by advertiser to see who is most active in a category.
- Sort by start date to find the newest creative, and by run length to find the long-running ones.
- Group by call to action to see how the category asks for the click.
- Read the longest-running ads in full. They are the closest thing to proof of what works.
The tool reads only what the public library shows. Use the results to study the market and to improve your own ads, not to copy someone else's work.