Call it
curl https://api.peume.com/v1/call/search-tiktok-top-results-by-keyword-videos-photos \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "funny",
"publish_time": "all-time",
"sort_by": "relevance"
}
}'const res = await fetch("https://api.peume.com/v1/call/search-tiktok-top-results-by-keyword-videos-photos", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "funny",
"publish_time": "all-time",
"sort_by": "relevance"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-tiktok-top-results-by-keyword-videos-photos",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "funny",
"publish_time": "all-time",
"sort_by": "relevance"
}
},
)
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: search-tiktok-top-results-by-keyword-videos-photos.
Parameters
queryRequiredstringKeyword to search for
Example: funny
publish_timestringTime Frame TikTok was posted
Example: all-time
sort_bystringSort by
Example: relevance
regionstringNote, this doesn't filter the tiktoks only in a specfic region, it puts the proxy there. Use it in case you want to scrape posts only available for some country. Use 2 letter country codes like US, GB, FR, etc
cursornumberCursor to get more videos. Get 'cursor' from previous response.
Other ways to do it
Same job, other sources.
