Skip to main content
Glama

TikTok Ad Library Scraper: Ads & Targeting · $0.30/1K

Meta Ad Library (Facebook and Instagram ads)

search_meta_ads
Read-onlyIdempotent

Ads from the Meta Ad Library by keyword, advertiser, Page ID, ad ID or library URL: creative (text, images, video links), landing link and call to action, platforms, start date, days running, variations and a winning score; spend and impressions where Meta publishes them. Filters by country, status, ad type, media, platform, language and dates; advertiser details and EU reach, every version of an ad, parallel big pulls, video transcript, text on the image, AI marketing analysis, landing page analysis, total count only and a new-ads monitor. No login or cookies needed from you. Use for ads on Facebook and Instagram (Meta Ad Library) by keyword, advertiser or ad ID; for ads on Google use search_google_ads. Returns {items: [...]} with one object per result, for example: {"status":"ok","adArchiveId":"1550534860016399","pageName":"Perfect themes","isActive":true,"startDate":"2026-05-19","activeDays":198,"variationCount":1,"winningScore":198,"platforms":["FACEBOOK","INSTAGRAM"],"text":"Themepack is a free app...","ctaText":"Install now","linkUrl":"https://example.com","adLibraryUrl":"https://www.facebook.com/ads/library/?id=1550534860016399"} Large requests return nextCursor: call again with only cursor to get the next page. Cost: pay per result (prices on the store page where you subscribed), or US$ 0.025 per call with x402 (up to 50 ads). Read-only: it only reads public data.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_meta_ads"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoKeywords to search. Comma-separate several (max 5). Give q, advertiser, page_id, ad_id or url.
maxNoMaximum ads (1-5000, default 20). One call returns up to about 100 ads (fewer with details, landing_page or save_media); send nextCursor for the rest.
urlNoAn Ad Library URL with your filters already set (one per call).
sortNoDefault relevance.
ad_idNoAd Library IDs. Comma-separate several (max 20).
cursorNoNext page: the nextCursor of the previous answer. Send it alone; the first call's parameters are kept. Cursors last 24 hours.
periodNoOnly ads that started in this period.
statusNoDefault active.
ad_typeNoDefault all.
countryNoCountry code (ISO 2 letters) or ALL; comma-separate up to 10. Default US.
detailsNoAdvertiser Page details, EU reach, targeting and demographics for each ad.
page_idNoFacebook Page IDs. Comma-separate several (max 5).
only_newNoOnly ads this API key has not received before under the same stateKey.
parallelNoFaster big pulls: reads each search as several streams at once (all, video, image, meme) and delivers every ad once. Row order is mixed.
stateKeyNoWith only_new: name of your monitor (letters, numbers, - and _).
variantsNoReturn every version Meta groups under one creative and text, one ad each.
languagesNoLanguage codes of the ad (comma-separated), e.g. en,es.
platformsNofacebook, instagram, audience_network, messenger, whatsapp, threads (comma-separated).
advertiserNoAdvertiser names, @handles or Facebook Page links. Comma-separate several (max 5).
image_textNoThe words written on the ad image or video cover (imageText).
media_typeNoDefault all.
save_mediaNoSave the creative files and return permanent links. Default none.
started_toNoOnly ads that started on or before this date (YYYY-MM-DD).
total_onlyNoOnly the number of ads of each search per country.
transcribeNoSpeech of each ad video as text: transcript, language, first 3 seconds (hook3s), timed segments. Fewer ads per call; send nextCursor for the rest.
ai_analysisNoMarketing reading of each ad (aiAnalysis): hook, offer, offer type, angle, emotional trigger, target persona, call to action, summary.
exact_phraseNoMatch the keywords as an exact phrase.
landing_pageNoRead each landing page: title, price, technologies and tracking IDs.
running_daysNoOnly ads running for at least this many days.
started_fromNoOnly ads that started on or after this date (YYYY-MM-DD).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent and open-world behavior, and the description adds real value on top: no login or cookies required, the exact cost model ($0.025 per call via x402 or pay-per-result), the ~50-ad cap per x402 call, and the nextCursor pagination contract with 24-hour cursor lifetime. What it omits is failure behavior (rate limits, invalid ID handling), which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and scope, then the return example, then pagination and cost — a sensible order. It is dense and somewhat run-on, with mild repetition of the 'by keyword, advertiser or ad ID' framing in the usage sentence, but almost every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 30-parameter, zero-required tool with no output schema, the description still covers return shape with a concrete example object, pagination via nextCursor, per-call limits and pricing. An agent has enough to construct a first call and to page results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description explains what several output-affecting flags actually yield: variations, video transcript, text on the image, AI marketing analysis, landing page analysis and advertiser/EU reach details. That goes beyond the schema's terse wording and helps the agent pick flags knowingly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (ads from the Meta Ad Library) plus the identifying keys it accepts (keyword, advertiser, Page ID, ad ID, URL) and the fields returned. It explicitly disambiguates from the sibling by naming search_google_ads for Google ads.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Makes the when-to-use condition explicit ('ads on Facebook and Instagram ... by keyword, advertiser or ad ID') and names the alternative tool and its domain when Meta is not the target. Optional modes (new-ads monitor, total count only, parallel big pulls) are tied to the parameters that enable them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.