Skip to main content

Reddit::Posts - Reddit post scraper

SE::Quora

Overview of the Reddit::Posts scraper​

The Reddit::Posts scraper collects lists of posts on Reddit.

It works with public reddit.com pages without requiring a Reddit account login. Based on the query format, one of the modes is selected: community feed (URL like /r/...), global search by keyword, or search within a specified community.

You can use automatic query expansion, substitution of subqueries from files, iteration of alphanumeric combinations, and lists to obtain the maximum possible number of results.

A-Parser functionality allows you to save Reddit::Posts scraper settings for future use (presets), set scraping schedules, and much more.

Saving results is possible in the form and structure you need, thanks to the built-in powerful Template Toolkit which allows applying additional logic to results and outputting data in various formats, including JSON, SQL, and CSV.

Collected data​

The $posts array (list of posts):

  • Post link ($posts.$i.link)
  • Title ($posts.$i.title)
  • Rating ($posts.$i.upvotes)
  • Number of comments ($posts.$i.comments)
  • Number of awards ($posts.$i.awards)
  • Creation date ($posts.$i.created)
  • Post flair ($posts.$i.flair)
  • Community ($posts.$i.subreddit)
  • Author ($posts.$i.author)
  • Author flair ($posts.$i.authorFlair)
  • Preview / media ($posts.$i.media)
  • Post content ($posts.$i.content)
  • Link to external resource from the post ($posts.$i.url)
  • Promoted post indicator ($posts.$i.promoted)

Features​

  • Configuration of the number of feed pages or search results
  • Separate sorting and period for search and for community feed (if sorting and result time are already specified in the subreddit URL, they are used, and feed settings are ignored)
  • Global search and search within a single community

Use Cases​

  • Any scenarios where you need to obtain data about messages (posts) on Reddit

Queries​

Three query variants are supported.

Subreddit feed. You can specify sorting and time in the URL just like on the Reddit website.

Example:

https://www.reddit.com/r/nba/
https://www.reddit.com/r/OrlandoMagic/top/?t=month

By default, the result will output a list of links to posts, for example:

https://www.reddit.com/r/OrlandoMagic/comments/14a5br2/
https://www.reddit.com/r/OrlandoMagic/comments/14nqfk1/keep_mo_or_no_mo/
https://www.reddit.com/r/nba/comments/14nfzki/202324_nba_free_agent_tracker/
...

Keywords​

Global site search.

Example:

wordpress features
parser

By default, the result will output a list of links to posts, for example:

https://www.reddit.com/r/ShitpostXIV/comments/14511em/i_am_a_proud_grey_parser/
https://www.reddit.com/r/opengl/comments/147sbjk/4_hours_of_my_obj_parser_so_far/
...

A phrase followed by a space and a subreddit URL — search only within that community.

jesus https://www.reddit.com/r/atheism/
stage 3 https://www.reddit.com/r/Audi/

By default, the result will output a list of links to posts, for example:

https://www.reddit.com/r/Audi/comments/vi6cs5/thoughts_on_used_stage_3_2017_a3/
https://www.reddit.com/r/Audi/comments/lfvjuo/just_picked_up_this_beauty_stage_3_b5_s4/
https://www.reddit.com/r/Audi/comments/ssr8ui/anyone_else_track_their_audis_ttrs_stage_3_big/
https://www.reddit.com/r/atheism/comments/14lq0y6/heaven_and_hell_are_not_what_jesus_preached/
https://www.reddit.com/r/atheism/comments/13gxzj6/so_jesus_freaks_can_shove_their_religion_onto/
https://www.reddit.com/r/atheism/comments/13b8kl6/chris_pratt_compares_his_struggles_to_jesus/
https://www.reddit.com/r/atheism/comments/137k88b/artwork_of_jesus_surrounded_by_hot_leather/
...

Result output options​

A-Parser supports flexible result formatting thanks to the built-in Template Toolkit, which allows it to output results in arbitrary forms, as well as structured formats like CSV or JSON.

Possible settings​

ParameterDefault valueDescription
Pages count5Maximum feed or search result pages per successful attempt (1–100)
Search sortRelevanceSearch sorting
Search timeAll timeSearch time range
Community sortBestCommunity feed sorting
Community timeTodayCommunity feed time range