Call it
curl https://api.peume.com/v1/call/search-reddit-posts-communities-comments-by-keyword \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "python programming",
"search_type": "post",
"sort": "RELEVANCE",
"time_range": "all",
"safe_search": "unset",
"allow_nsfw": "0"
}
}'const res = await fetch("https://api.peume.com/v1/call/search-reddit-posts-communities-comments-by-keyword", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "python programming",
"search_type": "post",
"sort": "RELEVANCE",
"time_range": "all",
"safe_search": "unset",
"allow_nsfw": "0"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-reddit-posts-communities-comments-by-keyword",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "python programming",
"search_type": "post",
"sort": "RELEVANCE",
"time_range": "all",
"safe_search": "unset",
"allow_nsfw": "0"
}
},
)
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-reddit-posts-communities-comments-by-keyword.
Parameters
queryRequiredstringSearch query
Example: python programming
search_typestring搜索类型/Search type: post(帖子), community(社区), comment(评论), media(媒体), people(用户)
Example: post
sortstring排序方式(仅适用于post/comment/media)/Sort method (only for post/comment/media): RELEVANCE(相关性), HOT(热门), TOP(最受欢迎), NEW(最新), COMMENTS(评论数,仅post). Prefer RELEVANCE when you want posts matching the query. sort=NEW is chronological newest-first and often returns weakly related or unrelated sitewide posts (not "recent posts about X"). Brand/token queries may also match colloquial substrings under NEW.
Example: RELEVANCE
time_rangestring时间范围(仅适用于post/media)/Time range (only for post/media): all(所有时间), year(去年), month(上月), week(上周), day(今天), hour(过去1小时)
Example: all
safe_searchstringSafe search setting: unset, strict
Example: unset
allow_nsfwstringAllow NSFW content: 0, 1
Example: 0
afterstringPagination parameter
need_formatbooleanWhether to clean and format the data
Example: false
Other ways to do it
Same job, other sources, cheapest first.
