【问题标题】:How to do a reddit search using API ? Not a subreddit searchHow to do a reddit search using API ? Not a subreddit search
【发布时间】:2022-12-28 04:05:13
【问题描述】:

The GUI search documentation for reddit (https://www.reddit.com/wiki/search/) says that it is possible to do a reddit search and retrieve Posts, Comments and Subreddits related to the search term.

Is there anyway to do something similar using the API? I've gone through PRAW but it only shows how to search within a Subreddit. What I want is to search reddit using API and retrieve Posts, Comments and Subreddits related to the search term.

Hope I've been able to explain my problem clearly :) I'm very bad in explaining things

【问题讨论】:

    标签: python reddit praw


    【解决方案1】:

    how to search reddit using PRAW

    it is quite simple the docs I used are here if you need any more information

    code:

    for submission in reddit.subreddit("all").search("SEARCH TERM"):
         print(submission.url)
         print(submission.id)
         print(submission.title)
    

    【讨论】:

      猜你喜欢
      • 2022-12-16
      • 2022-12-26
      • 2022-12-02
      • 2022-11-20
      • 2022-12-02
      • 2021-11-18
      • 2022-12-26
      • 2022-12-26
      • 2022-12-02
      相关资源
      最近更新 更多