# Facebook Ads Library API: pull a competitor's live ads and what they bid on in Google

Give your agent a competitor's Facebook page and get back their live Meta ads with the format, call to action and opening line of each, plus the same advertiser's ads in the Google Ads Transparency Center. 3 steps through one treg.to key, with the price printed before each.

## Try it

Setup line (paste into any agent): `set up treg — https://treg.to/llms.txt`

Then ask: "Using treg, count the active Meta ads for Notion (facebook.com/notionhq), then pull the 20 most recent. Show me the price first. Group them by format and call to action, and give me a CSV with ad_archive_id, started, format, cta, title and hook. Then list what the same company is running in the Google Ads Transparency Center."

- **Give a Page URL, not a keyword** A Page URL returns that advertiser's ads. A keyword returns everyone bidding on the phrase.
- **Count before you pull** The Meta route bills per ad returned. The count probe is one result; it tells you what an uncapped pull would cost.
- **Ask for format and CTA** The agent groups on two fields Meta renders for every ad. Grouped output is faster to review than raw creative.
- **Add the Google side** One cheap call returns the advertiser's Google ads by domain. Two libraries, one prompt.

## The steps

| # | Step | What the agent asks | Provider used | Price | Success rate |
|---|---|---|---|---|---|
| 1 | Count the ads first | how many active ads the Page runs, as one cheap result row | Apify (`apify.meta-ads.library.search`, 3 providers, https://treg.to/use-cases/ads-a-competitor-is-running-now) | $0.005 per result | 100% over 260 calls, 13.2s median |
| 2 | Pull the Meta ads | active ads for a Page from the Meta Ad Library, with creative text and format | Apify (`apify.meta-ads.library.search`, 3 providers, https://treg.to/use-cases/ads-a-competitor-is-running-now) | $0.005 per result | 100% over 260 calls, 13.2s median |
| 3 | Pull the Google ads | the same advertiser's ads in the Google Ads Transparency Center, by domain | SerpApi (`serpapi.google.ads.transparency`, 1 providers, https://treg.to/use-cases/ads-a-competitor-is-running-now) | $0.015 per found | 100% over 265 calls,  median |

- Count the ads first: onlyTotal:true returns the count as a single billed result. Read it before you decide how many ads to pull.
- Pull the Meta ads: Reads the Ad Library web UI. Billed per ad returned, so cap it with resultsLimit and maxItems.
- Pull the Google ads: One flat call per domain, with format and first-shown dates per creative. Failed and empty searches are free.

At the rates above, 20 rows where every call hits comes to $0.22. The receipt below is what it actually cost, and why it differs.

## What it actually cost

Run on 2026-09-14.

- Ads counted: 113 active ads on the Page, one result row
- Meta ads pulled: 20 active ads for Notion: 10 image, 6 dynamic creative, 4 video
- Calls to action: Sign up (13), Get offer (5), Apply now (2)
- Google ads pulled: 17 creatives on notion.so: 9 text, 7 image, 1 video
- Metered on treg's shared key: $0.015 for the Google call
- Not metered: the two Meta calls ran on this team's own Apify key, which treg never meters; on the shared key they bill at the rate in the table, $0.105 for the probe and 20 ads

The count probe came back as one result row, then twenty ads came back in one Meta call and 17 in one Google call. The worst-case total above counts the count probe once per row because it shares the pull's endpoint; in practice it is one result. Every Meta ad opened with the same line and pointed at a sign-up; the variety is in format, not copy. The Google side is mostly text ads. The Meta calls went out on the team's own Apify key, and a team's own key is never metered, so the receipt shows the shared-key rate for them separately. A run on treg's shared key bills them at the rate in the table.

Download the CSV of this run: https://treg.to/workflows/mine-competitor-meta-ads-as-creative-pack.csv

## Why go through treg.to

- **One key, not 9 accounts** treg.to holds the provider keys. Neither you nor the agent sees them.
- **Price before the call** The provider's own rate, $0.000 markup, from a prepaid balance.
- **No subscription, no seats** Charged per call. $1.00 free per new team, no card to start.
- **Your own keys are free** Already pay Hunter? Register it and those calls are never metered.
- **Switch by changing a word** Another provider is a different word in the prompt, not a new integration.
- **Nothing to integrate** No SDK, no OAuth dance per vendor, no seats.

## Where it goes wrong

**Advertiser not found** A wrong Page URL or an advertiser with no active ads returns zero results and costs nothing.

**Slow Meta pulls** The Meta route blocks until the scrape finishes and is cut at five minutes. Keep the limit small or use the asynchronous pair.

**Google domain mismatch** The Google side keys on the advertiser's verified domain. A marketing subdomain returns nothing; use the root domain.

**Creative fields shift** Both routes read the public library pages. Field availability tracks whatever Meta and Google currently render.

## Before you start

**What does a competitor pull cost?** It depends on how many ads they run. The Meta route bills per ad at the rate above; cap the count.

**Is this Meta's official API?** No. It reads the public Ad Library. Meta's own ads_archive route is free but needs identity verification and returns less.

**Can I pull TikTok or LinkedIn ads too?** Yes. The catalog has routes for both; the competitor-ads hub page compares them.

**What about the landing pages?** Ask the agent to scrape the link URLs from the CSV with a web-scrape route as a follow-up step.

## Related

- Ads a competitor is running now: https://treg.to/use-cases/ads-a-competitor-is-running-now
- Keywords a domain bids on: https://treg.to/use-cases/keywords-a-domain-bids-on
- Keyword volume, CPC and competition: https://treg.to/use-cases/keyword-volume-cpc-and-competition
- Your own campaign performance: https://treg.to/use-cases/your-own-campaign-performance

HTML version: https://treg.to/workflows/mine-competitor-meta-ads-as-creative-pack