Call it
curl https://api.peume.com/v1/call/instagram-search-the-by-keyword \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"search_terms": "project management software",
"search_type": "KEYWORD_UNORDERED",
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_size",
"ad_active_status": "ALL",
"ad_type": "ALL"
}
}'const res = await fetch("https://api.peume.com/v1/call/instagram-search-the-by-keyword", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"search_terms": "project management software",
"search_type": "KEYWORD_UNORDERED",
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_size",
"ad_active_status": "ALL",
"ad_type": "ALL"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/instagram-search-the-by-keyword",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"search_terms": "project management software",
"search_type": "KEYWORD_UNORDERED",
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_size",
"ad_active_status": "ALL",
"ad_type": "ALL"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: instagram-search-the-by-keyword.
Parameters
search_termsstringmax 100 characters; matched against the ad's text. Required in practice unless you filter by search_page_ids instead
Example: project management software
search_typestringKEYWORD_UNORDERED (default, all words in any order) | KEYWORD_EXACT_PHRASE
Example: KEYWORD_UNORDERED
ad_reached_countriesRequiredarrayREQUIRED on every ads_archive call. JSON array of ISO country codes, URL-encoded — ["US"] — or ALL
Example: ["US"]
fieldsRequiredstringcomma-separated; nothing but id comes back by default
Example: id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_
ad_active_statusstringACTIVE (default) | INACTIVE | ALL — ALL is what you want for creative research, since a competitor's best-performing ad may have finished
Example: ALL
ad_typestringALL (default) | POLITICAL_AND_ISSUE_ADS | HOUSING_ADS | EMPLOYMENT_ADS | FINANCIAL_PRODUCTS_AND_SERVICES_ADS
Example: ALL
ad_delivery_date_minstringYYYY-MM-DD; ads that were delivering on or after this date
Example: 2026-06-01
ad_delivery_date_maxstringYYYY-MM-DD
media_typestringALL | IMAGE | MEME | VIDEO | NONE
Example: VIDEO
publisher_platformsarrayFACEBOOK | INSTAGRAM | AUDIENCE_NETWORK | MESSENGER | WHATSAPP | OCULUS | THREADS
Example: ["INSTAGRAM"]
languagesarrayISO 639-1 codes (plus CMN, YUE)
Example: ["en"]
estimated_audience_size_minintegerone of the fixed buckets 100 | 1000 | 5000 | 10000 | 50000 | 100000 | 500000 | 1000000
limitintegerpage size; 25 by default, a few hundred is the practical ceiling before Meta starts timing out
Example: 25
afterstringpaging.cursors.after from the previous response
Other ways to do it
Same job, other sources, cheapest first.
