Call it
curl https://api.peume.com/v1/call/instagram-scrape-the-by-page-or-search-url \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"maxItems": 50,
"maxTotalChargeUsd": 0.5,
"timeout": 90,
"startUrls": [
{
"url": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=project%20management"
}
],
"resultsLimit": 50,
"activeStatus": "active"
}
}'const res = await fetch("https://api.peume.com/v1/call/instagram-scrape-the-by-page-or-search-url", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"maxItems": 50,
"maxTotalChargeUsd": 0.5,
"timeout": 90,
"startUrls": [
{
"url": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=project%20management"
}
],
"resultsLimit": 50,
"activeStatus": "active"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/instagram-scrape-the-by-page-or-search-url",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"maxItems": 50,
"maxTotalChargeUsd": 0.5,
"timeout": 90,
"startUrls": [
{
"url": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=project%20management"
}
],
"resultsLimit": 50,
"activeStatus": "active"
}
},
)
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-scrape-the-by-page-or-search-url.
Parameters
maxItemsintegeroptional row cap; pay-per-event actors that take the row count from their own input ignore it, so maxTotalChargeUsd is the spend limit
Example: 50
maxTotalChargeUsdnumberthe spend cap enforces on every event this run bills, in dollars. 's key requires it, above 0 and at most 1, and holds it for the call
Example: 0.5
timeoutinteger's key requires 1-90 so the run and its rows arrive before any wait gives up (a larger pull needs your own key). seconds before the synchronous run is cut off. This route blocks until the actor finishes and closes the connection at 300s regardless — use the async pair below for anything large
Example: 90
startUrlsRequiredarray[{"url": "…"}] — either a Facebook Page URL or a full search URL (facebook.com/ads/library/?q=…&country=US)
Example: [{"url":"https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=project%20management"}]
resultsLimitintegermax ads PER URL; unlimited if omitted, which is how runs get expensive
Example: 50
activeStatusstring"active" | "inactive" | "" for both
Example: active
isDetailsPerAdbooleantrue adds Instagram data, spend info and EU reach/targeting per ad — richer than Meta's own API, and slower
Example: false
includeAboutPagebooleantrue adds the advertiser's address, admin country and page history
onlyAdsNewerThanstringYYYY-MM-DD or a relative phrase like "2 months"
Example: 2026-06-01
onlyAdsOlderThanstringonlyTotalbooleantrue returns just the ad COUNT instead of the ads — one cheap result row when all you need is how much a competitor is running
Example: false
enrichWithEcommerceDatabooleantrue follows landing pages for product names and prices and bills an extra ecommerce-enrichment event per ad; 's key requires false, your own key may enable it
Example: false
Other ways to do it
Same job, other sources, cheapest first.
