データ API / Reddit / Search
Search Reddit
Searches every public subreddit for posts matching a query and returns posts plus an after token to page. Each post carries title, author, selftext, selftext_html, subreddit, score, ups, downs, upvote_ratio, num_comments, created_utc, created_at_iso, url, permalink, subreddit_subscribers, is_video, over_18 and spoiler. sort accepts relevance, new, top and comment_count, and timeframe narrows the window. To stay inside one community use get_reddit_subreddit_search, which is faster and pages with cursor rather than after; to read one post's discussion use get_reddit_post_comments.
パラメータ
クエリ
querystring必須Search query
sortstring任意指定できる値: relevance · new · top · comment_count
Sort by
timeframestring任意指定できる値: all · day · week · month · year
Timeframe
afterstring任意Used to paginate to next page
trimboolean任意Set to true for a trimmed down version of the response
リクエスト例
curl -G "https://openapi.felo.ai/v1/beta/reddit/search" \
--data-urlencode "query=<string>" \
-H "Authorization: Bearer $FELO_API_KEY"レスポンス
レスポンス例
{
"success": true,
"posts": [
{
"id": "w63dgy",
"author": "Morgentau7",
"author_fullname": "t2_2hy2xjit",
"subreddit": "MadeMeSmile",
"title": "Player realizes that he nearly stole the dogs job",
"downs": 0,
"name": "t3_w63dgy",
"upvote_ratio": 0.97,
"ups": 220403,
"total_awards_received": 0,
"score": 220403,
"created": 1658580900,
"num_comments": 1246,
"url": "https://www.reddit.com/r/MadeMeSmile/comments/w63dgy/player_realizes_that_he_nearly_stole_the_dogs_job/",
"subreddit_subscribers": 11605207,
"is_video": true,
"created_utc": 1658580900
}
],
"after": "t3_1izmcgx"
}レスポンスのフィールド
successboolean任意credits_remaininginteger任意postsobject[]任意after任意cursor任意