Call it
curl https://api.peume.com/v1/call/instagram-ads-for-a-keyword \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"active_status": "active",
"country": "US",
"limit": 20,
"query": "running shoes"
}
}'const res = await fetch("https://api.peume.com/v1/call/instagram-ads-for-a-keyword", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"active_status": "active",
"country": "US",
"limit": 20,
"query": "running shoes"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/instagram-ads-for-a-keyword",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"active_status": "active",
"country": "US",
"limit": 20,
"query": "running shoes"
}
},
)
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-ads-for-a-keyword.
Parameters
active_statusstringactive or all; default active
Example: active
countrystringALL or two letters (US, GB, DE); default ALL
Example: US
limitintegerat most 100; past the 30 ads one view shows, the search is split by media type, out of the Library's order; default 20
Example: 20
queryRequiredstringExample: running shoes
Other ways to do it
Same job, other sources, cheapest first.
Search the by keywordSearch publicly running Facebook and Instagram ads by keywordSearch Facebook ad library ads by keywordSearches the by keyword and returns matching ads.Search Facebook and Instagram ads by keywordReturn one page of matches for a keyword.Scrape the by Page or search URLScrape publicly running Facebook and Instagram ads for a page or Ad Library search
