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 after.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
search_terms | string | no | Keywords, 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_ids | array | no | Up to 10 Facebook Page IDs to restrict to, e.g. [“20531316728”]. A single numeric string or comma list is also accepted. |
items | string | no | |
ad_reached_countries | array | yes | Required. 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. |
items | string | no | |
ad_active_status | string | no | ACTIVE (default, as in the API), INACTIVE or ALL. |
ad_type | string | no | Ad category (default ALL). Anything but ALL narrows to a special category. |
publisher_platforms | array | no | Only ads shown on these Meta platforms, e.g. [“INSTAGRAM”]. Case-insensitive; a comma list string is also accepted. |
items | string | no | |
media_type | string | no | Only ads with this kind of media (default ALL). |
ad_delivery_date_min | string | no | Ads delivered on or after this date, YYYY-MM-DD. |
ad_delivery_date_max | string | no | Ads delivered on or before this date, YYYY-MM-DD. |
limit | number | no | Ads per page, 1-100 (default 25). |
after | string | no | The next_cursor from a previous response, to get the next page. |
_apiKey | string | no | Your 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
| Field | Type | Description |
|---|---|---|
source | string | Publisher and dataset |
count | number | Ads in this page of results |
ads | array | Ads in the Ad Library matching the search |
next_cursor | string | null | Cursor to pass as after for the next page, or null when there is no further page |
has_next_page | boolean | Whether another page exists |
coverage | string | What the Ad Library API does and does not cover, by region and ad type |
not_available | array | Fields a caller may expect that this API does not provide |
note | string | Present 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.