FahdS
FahdS

Reputation: 59

How to do a reddit search using API ? Not a subreddit search

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

Upvotes: 0

Views: 1215

Answers (1)

Angus
Angus

Reputation: 148

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)

Upvotes: 1

Related Questions