Data 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Необязательный