Skip to main content

Reddit

Type: reddit • Category: flow

Description

Check what’s on Reddit

Parameters

NameTypeDescriptionRequiredDefault
YOUR_CLIENT_IDstringYOUR_CLIENT_IDno
CLIENT_TOKENstringCLIENT_TOKENno
YOUR_CLIENT_SECRETstringYOUR_CLIENT_SECRETno
YOUR_USER_AGENTstringYOUR_USER_AGENTno
subredditstringExample wallstreetbetsno
limitnumberNumber of postsno100
sortstringSort typeno"new"

Help

Overview

The Reddit Fetcher worker connects to Reddit via the PRAW library and returns a list of posts from a specified subreddit. You can control how many posts are retrieved, which sorting method is used, and which fields are included in the output (title, body text, URL, score, and comment count). The worker operates in read‑only mode, making it safe for data‑gathering tasks such as market sentiment analysis or research pipelines.

Input Parameters

  • YOUR_CLIENT_IDstring – Your Reddit application client ID.
  • CLIENT_TOKENstring – The OAuth refresh token for the Reddit account.
  • YOUR_CLIENT_SECRETstring – Your Reddit application client secret.
  • YOUR_USER_AGENTstring – A descriptive user‑agent string (e.g., my‑app/1.0).
  • subredditstring – Name of the target subreddit (e.g., wallstreetbets).
  • limitnumber – Maximum number of posts to return (default = 100).
  • sortstring – Sorting method; accepted values are new, top, or hot (default = new).

Minimal Example Usage

# Define the required credentials and query parameters
params = {
"YOUR_CLIENT_ID": "abc123def456",
"CLIENT_TOKEN": "refresh_token_here",
"YOUR_CLIENT_SECRET": "secret_xyz",
"YOUR_USER_AGENT": "my-reddit-bot/0.1",
"subreddit": "wallstreetbets",
"limit": 50,
"sort": "top"
}

# When the worker runs, it will return a JSON‑serialisable list such as:
[
{
"title": "Why $XYZ is about to explode",
"text": "I’ve been tracking the fundamentals...",
"url": "https://reddit.com/r/wallstreetbets/comments/...",
"score": 12457,
"num_comments": 342
},

]

The example above fetches the 50 highest‑scoring posts from r/wallstreetbets. Adjust limit and sort to suit your analysis needs. The output can be piped directly into downstream steps (e.g., sentiment analysis, data storage, or visualization) within an automation platform such as n8n.