Felo API PlatformFelo API Platform

資料 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選填