Call it
curl https://api.peume.com/v1/call/scrape-the-tiktok-ad-library-by-keyword \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"maxItems": 50,
"maxTotalChargeUsd": 0.5,
"timeout": 90,
"search": "skincare",
"region": "all",
"query_type": "1"
}
}'const res = await fetch("https://api.peume.com/v1/call/scrape-the-tiktok-ad-library-by-keyword", {
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,
"search": "skincare",
"region": "all",
"query_type": "1"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/scrape-the-tiktok-ad-library-by-keyword",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"maxItems": 50,
"maxTotalChargeUsd": 0.5,
"timeout": 90,
"search": "skincare",
"region": "all",
"query_type": "1"
}
},
)
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: scrape-the-tiktok-ad-library-by-keyword.
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)
Example: 90
searchRequiredstringkeyword or advertiser name to search the ad library for
Example: skincare
adv_biz_idsstringadvertiser business id, to pin the search to one advertiser instead of a keyword
ad_idstringfetch one specific ad
regionstringISO country code or 'all' (the default). TikTok's library is a DSA transparency database, so coverage is EU/EEA/UK-centric — and per the actor's own input schema it REJECTS region=US; pass 'all' to include US ads
Example: all
query_typestringwhich field `search` is matched against: '1' = advertiser name (the actor's DEFAULT), '0' = keyword. A keyword passed without query_type:'0' is matched as an advertiser name and finds nothing
Example: 1
start_datestringYYYY-MM-DD
Example: 2026-06-01
end_datestringYYYY-MM-DD
sortstringlimitintegerresults to return; pair it with maxTotalChargeUsd
Example: 50
offsetintegerExample: 0
Other ways to do it
Same job, other sources, cheapest first.
