How to Build an Ad Spy Tool: Architecture, Real Costs and the Shortcut

How to build an ad spy tool like Foreplay or GetHookd: the six components, data sources, the full cost in engineering and data, and the faster shortcut.

The short answer

An ad spy tool is six parts: ingest, storage, media, enrichment, ranking and a UI, run as a daily snapshot job. Built in-house, the first year costs roughly $36,000 to $132,000 by our estimate (two to three months of a senior developer, maintenance and the data bill), and it still starts with no history and no spend data. The fastest and cheapest way is the Ad Radar Data API: 2,761 tagged, transcribed Meta ads with $50k+ estimated spend over REST and MCP, from $299 every 4 weeks.

In this article8 sections

What an ad spy tool actually is

If you are figuring out how to build an ad spy tool, a SaaS like Foreplay, GetHookd or Ad Radar, or just an internal competitor ad tracker, start by separating the product from the screenshots. Under the board of ads there are six jobs, and every tool in the category has to do each one well:

LayerJobWhat breaks if you skip it
IngestPull every active ad for a list of brands, every dayYou see one moment, not a trend
StorageKeep each ad and a daily snapshot of its signalsNo days live, no variant growth, no history
MediaDownload videos and images before their URLs expireDead thumbnails within days
EnrichmentTranscribe video, tag hooks, angles and formatsSearch only finds the written copy
RankingEstimate spend, score ads, mark winnersA wall of 50,000 ads nobody can read
UI and searchFilters, full text, alerts, exportNo product

The point most first builds miss: the series over time is the product. A single scrape tells you what is running. Thirty daily snapshots tell you what is scaling, what got cut after a week, and which brand just added six variants of the same hook. That is also why building late is so expensive: every day you are not collecting is a day of history you will never have.

Step-by-step architecture

1. Sources: the official API vs scrapers

You have three realistic ways to get Meta ads in bulk (all prices checked November 2026).

SourceCoveragePriceCatch
Meta Ad Library API (ads_archive)Political and issue ads worldwide, commercial ads only if they delivered in the EUFree, identity confirmation and developer app requiredUS-only commercial ads never return. No media file, no transcript
Apify Facebook Ads ScraperWhat the web library shows$5.80 per 1,000 ads on the free plan, down to $3.40 on BusinessPer-ad pricing gets expensive with daily snapshots
ScrapeCreators Ad Library endpointsCompany ads by Page ID, keyword search1 credit per request; $47 for 25,000 credits, $497 for 500,000Page size is not documented, so your real cost per brand is unknown until you test

Meta's reference says it plainly: ads that did not reach any EU location "will only return if they are about social issues, elections or politics." The rate limit is not published as a number, you just get error 613 when you exceed it. Our Meta Ad Library API guide covers every field. For a tool aimed at US DTC brands, the official API is a supplement at best, so you are buying or running a scraper no matter what.

2. Scheduling: daily snapshots

Run one job per brand per day. For each ad, upsert the ad itself (id, Page, copy, start date, media) and insert a snapshot row (date, active status, engagement, variant count). The snapshot table is what every later number is computed from. Keep it append-only: you will want to recompute scores with a new formula months from now, and you can only do that from raw history. Then you need monitoring, because a job that silently returns zero ads for a brand looks exactly like a brand that paused its ads.

3. Media: download before the URL dies

Video and image URLs on fbcdn.net are signed and short-lived. The oe parameter is an expiry timestamp, and changing it breaks the signature, so you cannot extend a link. Fivetran's troubleshooting note for its own Facebook Ads connector describes the same behavior: Meta rotates the URLs and older ones stop working. So you download every file during ingest, store it in your own bucket, and serve your URL, not Meta's. That is a media pipeline to build, pay for and keep running. The manual and extension routes to a single file are compared in our Ad Library video downloader piece.

4. Transcription

Most of the message in a video ad is spoken, not written. Extract the audio with ffmpeg and send it to a speech-to-text model. OpenAI lists gpt-4o-mini-transcribe at $0.003 per minute and Whisper at $0.006 per minute on its pricing page. The model is the easy part. The work is the queue around it: retries, de-duplication by media hash, and re-runs when a download failed.

5. Tagging with an LLM and a fixed taxonomy

Free-form AI tags ("engaging", "emotional") are useless for filtering. You need a fixed vocabulary with a definition per value, a model that picks from it and returns JSON, and a review loop to catch drift. Ad Radar uses ten dimensions: hook pattern, hook mechanism, narrative angle, reader awareness, proof level, production format, video type, landing page type, niche and CTA type. Our AI ad tagging guide shows what designing one involves. Anthropic's pricing page lists Claude Haiku 5.5 at $0.10 per million input tokens and $0.50 per million output, with 50% off through the Batch API. Again, the tokens are cheap; getting tags that a media buyer trusts takes weeks of iteration.

6. A spend estimate

Meta shows no spend for commercial ads, so you will model it. Options: public engagement times a multiplier, EU reach times an assumed CPM (only for EU-delivered ads), or a proxy from days live and variants. Ad Radar multiplies an ad's public reactions by one fixed multiplier and labels the result estimated spend everywhere, which makes it a consistent way to rank ads against each other. Building your own means picking inputs, handling ads whose post is shared across many ad IDs, and defending the number to your users. The trade-offs are in how to estimate competitor ad spend and our methodology.

7. A winner score

Combine the signals into one number, then rank within a peer group. A starting formula weighs estimated spend, engagement per day live, days live and variant growth. Then set a tier rule. Ad Radar's: a winner is in the top 10% by score and has run 21+ days, and a rising ad is growing fast before it gets there. A 21-day rule needs 21 days of your own snapshots before it says anything. Two lessons from our data: the oldest ad of a brand is rarely its biggest, and a jump in variants is often the clearest sign that a brand is putting money behind an ad (see ad variations as a scaling signal).

Postgres full-text search over headline, body and transcript, plus tag filters, then auth, billing, alerts and a UI people want to open every day. That last layer is your actual product, and it is the only part your users ever see.

What it really costs at ~1,000 brands

Assumptions: 1,000 brands, about 25 active ads each, one snapshot a day (about 750,000 ad records a month), about 15,000 new creatives a month of which about 10,000 are videos averaging 45 seconds. Public prices, checked November 2026.

The data and infrastructure bill

ComponentWhat it doesTool optionsRough monthly cost
IngestDaily pull of every active adMeta API (free, EU-delivered only); Apify $3.40 to $5.80 per 1,000 ads; ScrapeCreators $0.99 to $1.88 per 1,000 requests$0 (partial coverage); $2,550 to $3,750 (Apify); about $30 to $170 (ScrapeCreators, 30,000 to 90,000 requests, page size untested)
WorkersScheduler, queue, media download, ffmpegA small cloud VM, e.g. Hetzner from €5.49 a month€6 to €50
DatabaseAds, daily snapshots, tagsPostgres, e.g. Neon at $0.106 per CU-hour and $0.35 per GB-month$20 to $80
Media storageVideos and posters, kept foreverCloudflare R2 at $0.015 per GB-month, no egress feeAbout $3 in month one, about $40 after a year (225 GB added per month)
TranscriptionSpeech to textOpenAI gpt-4o-mini-transcribe $0.003/min, Whisper $0.006/min$23 to $45 (7,500 minutes)
TaggingTen fixed dimensions per adClaude Haiku 5.5 or Sonnet 5.5, Batch API at 50% offAbout $2 (Haiku, batch) to $90 (Sonnet)

That is $100 to $4,000 a month depending on which scraper pricing you end up on, and it is the smallest line in the budget.

The engineering bill

This is where the money goes. The Bureau of Labor Statistics puts the median software developer wage at $135,980 a year, with the top 10% above $214,670 (May 2025 data, checked November 2026). Taking a senior developer at $150,000 to $215,000 a year, our estimate is:

LineEstimateYear one
Build: 2 to 3 months of one senior developerSalary only, before benefits, payroll tax or a contractor's margin$25,000 to $54,000
Maintenance: 2 to 4 days a month on scraper breakage, Page ID mapping, re-runsAbout $580 to $830 per developer day$10,000 to $30,000
Data and infrastructureFrom the table above$1,200 to $48,000
Total, year oneroughly $36,000 to $132,000

These are estimates, and real numbers vary with location and seniority. But even the low end is about ten times the Ad Radar Data API's Builder plan, which is $299 every 4 weeks, or $3,887 a year, with the corpus already built, transcribed, tagged and ranked.

The costs no budget fixes

  • Anti-bot breakage. Scrapers read an interface built for people, and that interface changes without notice. Every breakage is a gap in your snapshots for the days it lasts, and a gap in a time series is permanent.
  • Page IDs. Brands advertise from several Pages: the main brand, founder pages, creator and partnership pages. Name lookups pick the wrong company. ScrapeCreators' own docs recommend pageId because "companyName is a convenience lookup and may select the wrong company." Mapping 1,000 brands to their real Page IDs is manual work, and it never finishes.
  • De-duplicating variants. One creative can run under dozens of ad IDs, with small text changes. Without grouping you show the same video twenty times and transcribe it twenty times. Hashing media and normalized text and grouping on that is one more subsystem to own.
  • History you can never recover. Outside the EU, a commercial ad leaves the public library when it stops running. Political and issue ads are kept seven years, according to Meta's Ad Library tools page, but ordinary DTC ads are not. If you start tracking a brand today, its winners from last spring are gone for good.
  • Missing spend, transcripts and tags on day one. Your first month of data has no reliable winner tier, because the tier needs weeks of snapshots, and a spend model you have not yet validated.
  • Legal and terms of service. Meta's developer policies say "Platform APIs are the only allowable means to access data programmatically, unless you have our prior written permission." On the other side, in Meta v. Bright Data (N.D. Cal., January 2024) the court held that Meta's terms did not cover logged-off scraping of public data (summary by Farella Braun + Martel). That was one district court ruling on specific contract language, and terms change. This is not legal advice: get your own before you sell a product built on scraped data.

A realistic timeline

Our estimate for one senior developer:

WeeksMilestone
1 to 3Brand list, Page ID mapping, ingest job, snapshot schema, monitoring
4 to 6Media download, storage, transcription queue, de-duplication
7 to 9Taxonomy, LLM tagging, spend estimate, winner score
10 to 12Search, filters, UI, auth, billing
Month 4+The data starts to mean something: a 21-day rule needs 21 days of snapshots, and trends need more

So expect two to three months of build, a month or more of waiting for the series to fill, and maintenance for as long as the product lives. Meanwhile, the tool you are trying to build already exists as an API.

Build vs buy the data

Build the pipelineAd Radar Data API
Time to the first useful winner list3 to 4 months (build plus 21+ days of snapshots)Minutes after checkout
Up-front engineering$25,000 to $54,000 by our estimateNone: you build only your product layer
Running cost$100 to $4,000 a month in data, plus maintenance days$299 every 4 weeks (Builder)
HistoryStarts the day you start collectingCorpus already built and refreshed daily
SpendA model you build and defendspendEstimate on every ad
TranscriptsA media and speech-to-text pipeline you runFull transcript on every video ad, searchable with q
TagsA taxonomy and LLM loop you designTen dimensions on every ad
Winner rankingA score and tier rule you tune for monthsScore and tier (winner, rising) on every ad
Scraper breakageGaps in your dataYou call one documented REST endpoint
AgentsBuild your own MCP serverMCP server included, same key

The shortcut: build only your product layer

The fastest and cheapest way to build an ad spy tool is to skip ingest, media, transcription, tagging and ranking entirely. The Ad Radar Facebook ads API is the best database of winning Meta ads you can plug into a product: 2,761 Meta ads with $50k+ estimated spend from 734 brands, built from the public Meta Ad Library and refreshed every day. Each ad comes with headline, body, CTA, full video transcript (searchable with q), estimated spend, score, tier, days running, variants, tags on the ten dimensions above, public poster and video URLs served by Ad Radar (not the expiring Meta CDN links), and links back to the library.

2,761

Meta ads with $50k+ estimated spend

782

brands

10

tag dimensions per ad

Daily

refresh

Base URL https://app.ad-radar.dev/api/v1, Bearer auth, JSON, cursor pagination, up to 100 results per page. The full reference is in the API docs. A first request:

curl "https://app.ad-radar.dev/api/v1/ads/search?q=skillet&tier=winner&format=video&limit=2" \
  -H "Authorization: Bearer $AD_RADAR_KEY"

A small Node 18+ script that searches winning video ads and then pulls every ad that entered the winner tier in the last seven days:

// winners.mjs   run: AD_RADAR_KEY=ar_live_... node winners.mjs
// AD_RADAR_KEY: your API key from Settings → API after checkout
const BASE = "https://app.ad-radar.dev/api/v1";

async function get(path, params = {}) {
  const url = new URL(BASE + path);
  for (const [k, v] of Object.entries(params)) if (v != null) url.searchParams.set(k, v);
  const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.AD_RADAR_KEY}` } });
  const body = await res.json();
  if (!res.ok) throw new Error(`${res.status} ${body.error}`);
  console.error("quota left:", res.headers.get("X-Quota-Remaining"));
  return body;
}

// 1. Winning video ads whose copy or transcript mentions "sleep"
const search = await get("/ads/search", { q: "sleep", tier: "winner", format: "video", limit: 10 });
for (const ad of search.data) {
  console.log(`${ad.brand} | est. $${Math.round(ad.spendEstimate).toLocaleString("en-US")} | ${ad.metrics.daysRunning} days | ${ad.headline}`);
}

// 2. Ads that became winners in the last 7 days, every page (capped at 500 ads)
const since = new Date(Date.now() - 7 * 864e5).toISOString().slice(0, 10);
const fresh = [];
let cursor = null;
do {
  const page = await get("/winners", { since, limit: 100, cursor });
  fresh.push(...page.data);
  cursor = page.pagination.hasMore ? page.pagination.nextCursor : null;
} while (cursor && fresh.length < 500);
console.log(`${fresh.length} new winners since ${since}`);

The same in Python, standard library only:

import json, os, urllib.parse, urllib.request

# AD_RADAR_KEY: your API key from Settings → API after checkout
def get(path, **params):
    url = "https://app.ad-radar.dev/api/v1" + path + "?" + urllib.parse.urlencode(params)
    req = urllib.request.Request(url, headers={"Authorization": "Bearer " + os.environ["AD_RADAR_KEY"]})
    with urllib.request.urlopen(req) as res:
        return json.load(res)

for ad in get("/winners", since="2026-11-01", limit=10)["data"]:
    print(ad["brand"], ad["metrics"]["tier"], ad["spendEstimate"], ad["headline"])

Other endpoints you will likely use: /ads/{key} for one ad, /brands and /brands/{id}/hooks for a brand's hooks, /patterns for what the winners share, /taxonomy for tag values, /me for your quota (never counted). On Scale, /feed gives an incremental sync since a cursor, so you can mirror the corpus into your own database. Over quota you get a 429 with an upgrade link, never an overage charge, and every response carries X-Quota-Remaining and X-RateLimit-Remaining.

For agent builders: MCP

If you are building an agent rather than an app, the same key works on the MCP server at https://app.ad-radar.dev/api/mcp, with the tools search_ads, get_ad, winning_patterns, advertiser_hooks, get_swipe_prompt and list_taxonomy. In Claude Code:

claude mcp add --transport http ad-radar https://app.ad-radar.dev/api/mcp \
  --header "Authorization: Bearer $AD_RADAR_KEY"

One MCP tool call counts as one request. Setup for Claude Desktop, claude.ai and ChatGPT is on the MCP page.

Plans

Billed every 4 weeks:

PlanPriceRequestsWhat you can do
Builder$29910,000Use inside your product and show data to your users (no raw redistribution); includes the web app
Scale$79950,000Builder plus /feed and a higher rate limit
ResellerFrom $2,000Custom/export (full NDJSON), resale and white-label, by request

Start on Builder, copy your key from Settings, and run the script above today. When you need incremental sync, move to Scale. All plans are compared on /api#pricing. If you are weighing a tool that sells API credits on top of a seat plan, see Foreplay pricing and Ad Radar vs Foreplay.

What building it yourself really involves

If you still plan to build every layer, this is the work list, and each line is weeks, not hours:

  1. Write the brand list and map each brand to all its Page IDs, then keep that map current forever.
  2. Pick a source per market: the Meta API for EU and political ads, a paid scraper for US commercial ads.
  3. Create an append-only daily snapshot table and start collecting now, knowing everything before today is gone.
  4. Build a media pipeline that downloads every file during ingest, because fbcdn URLs expire.
  5. Hash media and normalized text to group variants before you transcribe or tag.
  6. Run a transcription queue with retries for every unique creative.
  7. Design a ten-dimension tag taxonomy and an LLM loop that applies it consistently.
  8. Build and validate a spend model, then a winner score and tier rule that only works after weeks of data.
  9. Set up monitoring so a broken scraper does not look like a paused brand.
  10. Get legal advice on your data source before you charge for it.

Or skip the list: the Ad Radar Facebook ads API already did this work for you, and the Builder plan costs less per year than two weeks of the engineering time. If you are not a developer and just want the winning ads, the Ad Radar app gives you the winning ads with no code, and our best ad spy tools comparison and how to find winning Facebook ads show what to do with it.

Figures marked as estimated spend come from Ad Radar's model of engagement on public Meta Ad Library ads. They are estimates, labeled as such, and are best used to rank ads against each other. How the board is built.

FAQ

Questions

How much does it cost to build an ad spy tool?

By our estimate, roughly $36,000 to $132,000 in the first year for about 1,000 brands. That is two to three months of a senior developer to build it ($25,000 to $54,000 in salary alone, based on BLS pay data), a few days a month of maintenance when scrapers break, and a data and infrastructure bill of $100 to $4,000 a month depending on the scraper's pricing. The Ad Radar Data API starts at $299 every 4 weeks, about $3,900 a year, with the corpus already built.

Can I use the Meta Ad Library API to build an ad spy tool?

Only partly. Meta's ads_archive endpoint returns political and issue ads worldwide, but commercial ads only if they delivered somewhere in the EU. A US-only brand's ads never come back. It also returns no video file, no transcript and no spend for commercial ads, so you still need a scraper, a transcription pipeline and a spend model on top.

Is it legal to scrape the Facebook Ad Library?

It is contested, and this is not legal advice. Meta's developer policies say Platform APIs are the only allowed way to access data programmatically without prior written permission. In Meta v. Bright Data (N.D. Cal., January 2024), a federal district court held that Meta's terms did not bar logged-off scraping of public data, but that was one trial-court ruling on specific contract language. Talk to a lawyer in your jurisdiction before you build on scraped data.

How do ad spy tools estimate spend?

Meta shows no spend for commercial ads, so every figure is a model. Common inputs are public engagement such as reactions, EU reach multiplied by an assumed CPM, and days live combined with the number of variants. Ad Radar multiplies an ad's public reactions by a fixed multiplier and labels the result estimated spend, which is the right way to rank ads against each other.

What is the fastest way to build an ad spy tool?

Skip the data pipeline and build only your product on top of the Ad Radar Data API. It returns Meta ads with $50k+ estimated spend from 734 brands, refreshed daily, each with transcript, estimated spend, score, tier, days running, variants and tags on ten dimensions, over REST and MCP. The Builder plan is $299 every 4 weeks for 10,000 requests and lets you show the data to your own users.

Ad data and APIs

Keep reading

All 22 articles in Ad data and APIs

Build on ads that are already winning.

Skip the scraping, storage, transcription and tagging. Query the corpus from your code or your agent.

Builder: 10,000 requests every 4 weeks over REST and MCP, $299. Scale and Reseller for bigger volumes.