Scrape ads from the Meta ad library
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.meta.ads.search({ query: "nike", platforms: ["instagram"], language: "en" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.meta.ads.search(query="nike", platforms=["instagram"], language="en")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/meta/ads/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"query":"nike","platforms":["instagram"],"language":"en"}'
stophy meta ads search nike --platforms instagram --language en
{
"success": true,
"data": {
"results": [
{
"adId": "abc123",
"adUrl": "https://example.com/",
"pageId": "abc123",
"pageName": "example",
"pageUrl": "https://example.com/",
"pageAvatarUrl": "https://example.com/image.jpg",
"pageCategories": [
"example"
],
"pageLikes": 1234,
"isActive": false,
"firstShownAt": "2026-09-28T12:00:00.000Z",
"lastShownAt": "2026-09-28T12:00:00.000Z",
"platforms": [
"example"
],
"format": "example",
"text": "A short, readable summary of the result.",
"linkUrl": "https://example.com/",
"linkTitle": "example",
"linkDescription": "example",
"ctaText": "example",
"imageUrls": [
"https://example.com/image.jpg"
],
"videoUrls": [
"https://example.com/"
],
"cards": [
{
"text": "A short, readable summary of the result.",
"linkUrl": "https://example.com/",
"linkTitle": "example",
"ctaText": "example",
"imageUrl": "https://example.com/image.jpg",
"videoUrl": "https://example.com/"
}
],
"versions": 1,
"categories": [
"example"
],
"paidBy": "example",
"spendMin": 1,
"spendMax": 1,
"spendCurrency": "example",
"impressionsMin": 1,
"impressionsMax": 1,
"reachMin": 1,
"reachMax": 1,
"countries": [
"example"
]
}
]
},
"creditsUsed": 1,
"requestId": "005b0fec-2906-4e8c-8c71-9acea1d4f304"
}
Endpoints
| Endpoint | Cost |
|---|---|
| Scrape ads from the Meta ad library | 1 credit |
| Scrape a Meta ad’s details | 1 credit |
| Scrape the ads a Facebook page runs | 1 credit |
| Scrape ads from the Google ads library | 1 credit (no key needed) |
| Scrape a Google ad’s details | 1 credit |
| Scrape advertisers from the Google ads library | 1 credit |
| Scrape ads from the TikTok ad library | 1 credit |
| Scrape a TikTok ad’s details | 1 credit |
| Scrape ads from the LinkedIn ad library | 1 credit |
| Scrape a LinkedIn ad’s details | 1 credit |
More ways to call it
Scrape ads from the Google ads library
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.google.ads.search({ domain: "nike.com" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.google.ads.search(domain="nike.com")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/google/ads/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"domain":"nike.com"}'
stophy google ads search --domain nike.com
Scrape advertisers from the Google ads library
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.google.ads.advertisers({ query: "nike" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.google.ads.advertisers(query="nike")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/google/ads/advertisers \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"query":"nike"}'
stophy google ads advertisers nike
Google ad search works without a key. Each library has a search and an ad endpoint, and Google also has an advertisers endpoint. Each search needs a keyword, an advertiser or both, except Google, which takes a domain or an advertiser. Each endpoint’s reference says what it accepts.