meta_ad_library_search

Pack: meta-ad-library · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/meta_ad_library_search for the schema, then POST the same URL with its arguments for the data.

ANSWERS “what ads is running on Facebook / Instagram”, “who is advertising in ”, searches Meta’s public Ad Library by keyword and/or Facebook Page ID and returns, per ad: ad archive ID, Page ID and name, publisher platforms (Facebook, Instagram, …), whether it is active, start and end dates, ad text, link titles, captions and descriptions, and the snapshot URL that shows the ad. Political/issue ads also carry funder (bylines), spend and impressions ranges; EU/UK ads carry reach and targeting. Pages through results with after.

Parameters

NameTypeRequiredDescription
search_termsstringnoKeywords, up to 100 characters; a space means AND. Write them in the language of the ads (not translated). Give this and/or search_page_ids.
search_page_idsarraynoUp to 10 Facebook Page IDs to restrict to, e.g. [“20531316728”]. A single numeric string or comma list is also accepted.
itemsstringno
ad_reached_countriesarrayyesRequired. ISO 3166 alpha-2 codes where the ad was shown, e.g. [“US”] or [“DE”,“FR”]; “ALL” for every country. A comma list string is also accepted.
itemsstringno
ad_active_statusstringnoACTIVE (default, as in the API), INACTIVE or ALL.
ad_typestringnoAd category (default ALL). Anything but ALL narrows to a special category.
publisher_platformsarraynoOnly ads shown on these Meta platforms, e.g. [“INSTAGRAM”]. Case-insensitive; a comma list string is also accepted.
itemsstringno
media_typestringnoOnly ads with this kind of media (default ALL).
ad_delivery_date_minstringnoAds delivered on or after this date, YYYY-MM-DD.
ad_delivery_date_maxstringnoAds delivered on or before this date, YYYY-MM-DD.
limitnumbernoAds per page, 1-100 (default 25).
afterstringnoThe next_cursor from a previous response, to get the next page.
_apiKeystringnoYour Meta access token (BYO).

Example call

Arguments

{
  "search_terms": "electric vehicle",
  "ad_reached_countries": [
    "DE"
  ],
  "ad_active_status": "ALL",
  "limit": 5
}

curl

curl -X POST https://gateway.pipeworx.io/meta-ad-library/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"meta_ad_library_search","arguments":{"search_terms":"electric vehicle","ad_reached_countries":["DE"],"ad_active_status":"ALL","limit":5}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('meta_ad_library_search', {
  "search_terms": "electric vehicle",
  "ad_reached_countries": [
    "DE"
  ],
  "ad_active_status": "ALL",
  "limit": 5
});

Response shape

Always returns: source, count, ads, next_cursor, has_next_page, coverage, not_available

FieldTypeDescription
sourcestringPublisher and dataset
countnumberAds in this page of results
adsarrayAds in the Ad Library matching the search
next_cursorstring | nullCursor to pass as after for the next page, or null when there is no further page
has_next_pagebooleanWhether another page exists
coveragestringWhat the Ad Library API does and does not cover, by region and ad type
not_availablearrayFields a caller may expect that this API does not provide
notestringPresent only when no ads were returned: says an empty result is not proof of no ads
Full JSON Schema
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "Publisher and dataset"
    },
    "count": {
      "type": "number",
      "description": "Ads in this page of results"
    },
    "ads": {
      "type": "array",
      "description": "Ads in the Ad Library matching the search",
      "items": {
        "type": "object",
        "properties": {
          "ad_archive_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ad Library ID of the ad"
          },
          "page_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID of the Facebook Page that ran the ad"
          },
          "page_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the Page that ran the ad"
          },
          "publisher_platforms": {
            "type": "array",
            "description": "Meta platforms the ad appeared on, e.g. FACEBOOK, INSTAGRAM",
            "items": {
              "type": "string"
            }
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "true or false when known (from the requested status filter or the stop time), null when the API does not say"
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery start time"
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery stop time; null when none was reported"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the ad was created"
          },
          "ad_text": {
            "type": "array",
            "description": "Text of each ad card",
            "items": {
              "type": "string"
            }
          },
          "ad_title": {
            "type": "array",
            "description": "Link title of each ad card",
            "items": {
              "type": "string"
            }
          },
          "caption": {
            "type": "array",
            "description": "Link caption of each ad card",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "array",
            "description": "Link description of each ad card",
            "items": {
              "type": "string"
            }
          },
          "snapshot_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL that renders the archived ad"
          },
          "languages": {
            "type": "array",
            "description": "ISO 639-1 language codes of the ad",
            "items": {
              "type": "string"
            }
          },
          "funded_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Paid-for-by name; political and issue ads only"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Currency of spend; political and issue ads only"
          },
          "spend": {
            "description": "Spend range {lower_bound, upper_bound}; political and issue ads only, else null"
          },
          "impressions": {
            "description": "Impressions range {lower_bound, upper_bound}; political and issue ads only, else null"
          },
          "eu_total_reach": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated EU reach; EU-delivered ads only"
          },
          "target_ages": {
            "type": [
              "array",
              "null"
            ],
            "description": "Targeted age ranges; UK and EU ads only",
            "items": {}
          },
          "target_gender": {
            "type": [
              "string",
              "null"
            ],
            "description": "Targeted gender; UK and EU ads only"
          },
          "target_locations": {
            "type": [
              "array",
              "null"
            ],
            "description": "Targeted locations; UK and EU ads only",
            "items": {}
          }
        },
        "required": [
          "ad_archive_id",
          "page_id",
          "page_name",
          "publisher_platforms",
          "is_active",
          "start_date",
          "end_date",
          "created_at",
          "ad_text",
          "ad_title",
          "caption",
          "description",
          "snapshot_url",
          "languages",
          "funded_by",
          "currency",
          "spend",
          "impressions",
          "eu_total_reach",
          "target_ages",
          "target_gender",
          "target_locations"
        ]
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Cursor to pass as `after` for the next page, or null when there is no further page"
    },
    "has_next_page": {
      "type": "boolean",
      "description": "Whether another page exists"
    },
    "coverage": {
      "type": "string",
      "description": "What the Ad Library API does and does not cover, by region and ad type"
    },
    "not_available": {
      "type": "array",
      "description": "Fields a caller may expect that this API does not provide",
      "items": {
        "type": "string"
      }
    },
    "note": {
      "type": "string",
      "description": "Present only when no ads were returned: says an empty result is not proof of no ads"
    }
  },
  "required": [
    "source",
    "count",
    "ads",
    "next_cursor",
    "has_next_page",
    "coverage",
    "not_available"
  ]
}

Connect

Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the meta-ad-library pack
{
  "mcpServers": {
    "meta-ad-library": {
      "url": "https://gateway.pipeworx.io/meta-ad-library/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build December 4, 2026