Call it
curl https://api.peume.com/v1/call/instagram-facebook-ad-library-company-ads-by-page-id \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"pageId": "367152833370567",
"companyName": "Lululemon",
"country": "ALL",
"status": "ACTIVE",
"media_type": "ALL",
"language": "EN"
}
}'const res = await fetch("https://api.peume.com/v1/call/instagram-facebook-ad-library-company-ads-by-page-id", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"pageId": "367152833370567",
"companyName": "Lululemon",
"country": "ALL",
"status": "ACTIVE",
"media_type": "ALL",
"language": "EN"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/instagram-facebook-ad-library-company-ads-by-page-id",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"pageId": "367152833370567",
"companyName": "Lululemon",
"country": "ALL",
"status": "ACTIVE",
"media_type": "ALL",
"language": "EN"
}
},
)
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-facebook-ad-library-company-ads-by-page-id.
Parameters
pageIdstringThe companies ad library page id. You can get this with my Search For Companies Endpoint. Can either use this or companyName
Example: 367152833370567
companyNamestringThe name of the company. Can either use this or pageId
Example: Lululemon
countrystringThis can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
Example: ALL
statusstringStatus of the ad. Defaults to ACTIVE.
Example: ACTIVE
media_typestringMedia type of the ad. Defaults to ALL. Meme refers to ads with image and text. Not sure why they call it meme.
Example: ALL
languagestringLanguage to filter ads on. Needs to be 2 letter language code, ie EN, ES, FR, etc
Example: EN
sort_bystringSort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
Example: total_impressions
start_datestringStart date to search for. Format: YYYY-MM-DD
Example: 2025-01-01
end_datestringEnd date to search for. Format: YYYY-MM-DD
Example: 2025-12-31
cursorstringCursor to paginate through results
Example: AQHRBUAxNmFlxBVMFL6uTb1ICFsV65O4SqmPbcVZJhiveBpPS1hFHAmL6yCJcF760cXP
trimbooleanSet to true for a trimmed down version of the response
Example: false
Other ways to do it
Same job, other sources, cheapest first.
