# Query the Meta Ad Library from your code without a Meta developer app

RouterGrowth is independent of Meta and is not its official Ad Library API. It gives your code or agent one REST call instead: POST capability ads.search with an advertiser or keyword, and get the ads back as JSON with advertiser, headline, body text, start date, format and preview URL fields. No Meta developer app to register.

HTML page: https://www.routergrowth.com/tools/ad-library/facebook-ads-library-api
Part of: [Ad libraries tools](https://www.routergrowth.com/tools/ad-library.md)

## The call

[`ads.search`](https://www.routergrowth.com/catalog/ads.search): Public ad creatives from the Meta Ad Library (advertiser or keyword) or the Google Ads Transparency Center (advertiser domain).

Price on this network: $0.00875 per search, $0.002 minimum a call. The exact quote is shown before every run.

## What a real run returned

Run on 2026-10-19: 5 records in 15.7 s for $0.04375. Personal fields are masked. Five ads for a wallet brand's name: two from the brand itself, shown here, and three from other pages whose ads mention it, which a script should filter by advertiser.

| advertiser | headline | text | started |
|---|---|---|---|
| The Ridge | All Wallets - In Aluminum, Titanium, & Carbon Fiber // The Ridge | Upgrade your wallet to Ridge. Metal, RFID-blocking wallets designed to carry cards and cash safely and securely. | 2026-09-17 |
| The Ridge | {{product.name}} | Smarter essentials - power, protection, connection, and security. Shop 5-in-1 Ridge Power Banks, Tracker Cards, Fast Wall Chargers. and mor… | 2026-09-30 |

## How to do it

1. **Get a key.** Create a RouterGrowth API key in the dashboard. There is no Meta app review or identity check on your side.
2. **POST the search.** Send capability ads.search with input query, platform meta and limit, plus a max_cost.
3. **Parse the JSON.** result.ads is a list of objects with advertiser, headline, text, url, started_at as a Unix timestamp, format and preview_url.
4. **Filter by advertiser.** A brand name query also returns other pages that mention it. Keep the rows whose advertiser matches.

## Ask it like this

- Write a script that calls RouterGrowth ads.search for each competitor name in a list and saves the ads to JSON files. (`ads.search`)
- Every Monday, pull the new Meta ads of these five brands and post the ones started this week to our channel. (`ads.search`)

## Connect

MCP server: `https://api.routergrowth.com/mcp`

```bash
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
```

```bash
npm install -g routergrowth && routergrowth setup
routergrowth run -c ads.search -i '{"query": "Ridge Wallet", "platform": "meta", "limit": 5}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "ads.search", "input": {"query": "Ridge Wallet", "platform": "meta", "limit": 5}}'
```

## Worth knowing

- **Not Meta's API.** This is an independent route to public Ad Library data, with its own response shape. It is not affiliated with Meta.
- **Timestamps are Unix seconds.** started_at is a Unix timestamp. Convert it to a date in your code.
- **Same call as the MCP tool.** Agents and scripts call the same capability, so a prompt you test in Claude maps to one request.

## Questions

### Do I need a Facebook developer account?

No. The request uses your RouterGrowth key only.

### Does it return spend and impressions?

No. The records cover the creative and its start date. Spend estimates are a separate capability.

### Can I search by keyword instead of a brand?

Yes. The query field takes an advertiser name or a keyword.

### How are calls billed?

Per search, with a quote before the run. A search with no ads is not charged.

### Which ads are covered?

Ads shown in the public Meta Ad Library for the query, across Meta's apps.

## Related

- [Search the Meta Ad Library for a keyword and read every ad that comes back](https://www.routergrowth.com/tools/ad-library/facebook-ads-library-search.md)
- [Pull a brand's Facebook and Instagram ads without running a scraper](https://www.routergrowth.com/tools/ad-library/facebook-ads-library-scraper.md)
