Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get all posts for a given subreddit instead of just the posts newer than one month?

Is there a way to get all posts for a given subreddit instead of just the posts newer than one month?

For example, this is the "last" page of posts from IAmA subreddit we can get to, http://www.reddit.com/r/IAmA/?count=900&limit=100&after=t3_1k3tm1, and clearly this is not the last page of posts. It does not include any posts older than one month.

like image 594
shengmin Avatar asked Sep 18 '13 20:09

shengmin


People also ask

How do I get all posts from a subreddit?

1 Answer. Show activity on this post. Now https://www.reddit.com/r/[subreddit]/new.json returns all the post from a subreddit.

How do I find my old post in a subreddit?

To perform a Reddit comment search, ensure that you're on the "Search" category on the first row of options. On the second row, unselect "Posts" and select "Comments". On the third row, select the span of time you want to search in.

What is Pushshift io?

Pushshift is a social media data collection, analysis, and archiving platform that since 2015 has collected Reddit data and made it available to researchers. Pushshift's Reddit dataset is updated in real-time, and includes historical data back to Reddit's inception.


1 Answers

After playing around with Reddit, I found a way to fetch all posts of a given subreddit is to use its search interface: http://www.reddit.com/r/<subreddit>/search.json?restrict_sr=on&t=all. For example, you can get all posts under IAmA subreddit using this request endpoint: http://www.reddit.com/r/IAmA/search.json?restrict_sr=on&t=all

like image 180
shengmin Avatar answered Sep 30 '22 17:09

shengmin