问题所在
Reddit API OAuth rate API 100
Scavio 解决方案
Scavio Reddit API Reddit API OAuth Reddit
之前
Scavio Reddit OAuth token refresh
之后
Scavio Reddit JSON OAuth token
适用人群
核心优势
- Reddit OAuth
- JSON
- API Reddit GoogleYouTubeAmazon
Python 示例
Python
import requests
API_KEY = "your_scavio_api_key"
def search_reddit(query: str) -> list[dict]:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "reddit", "query": query},
timeout=15,
)
res.raise_for_status()
data = res.json()
posts = []
for r in data.get("organic", [])[:10]:
posts.append({
"title": r.get("title", ""),
"snippet": r.get("snippet", ""),
"link": r.get("link", ""),
"subreddit": r.get("source", ""),
})
return posts
posts = search_reddit("best search API for agents 2026")
for p in posts:
print(f"[{p["subreddit"]}] {p["title"]}")
print(f" {p["snippet"][:100]}")JavaScript 示例
JavaScript
const API_KEY = "your_scavio_api_key";
async function searchReddit(query) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: { "x-api-key": API_KEY, "content-type": "application/json" },
body: JSON.stringify({ platform: "reddit", query }),
});
if (!res.ok) throw new Error(`scavio ${res.status}`);
const data = await res.json();
return (data.organic ?? []).slice(0, 10).map((r) => ({
title: r.title ?? "", snippet: r.snippet ?? "", link: r.link ?? "", subreddit: r.source ?? "",
}));
}
const posts = await searchReddit("best search API for agents 2026");
posts.forEach((p) => console.log(`[${p.subreddit}] ${p.title}`));使用的平台
来自任何subreddit的社区、帖子及线程评论