Reddit Node

Extract Reddit data with the Anysite Reddit node for n8n workflows

Overview

The Anysite Reddit node allows you to extract valuable data from Reddit within your n8n workflows. Search posts, monitor subreddits, analyze discussions, and track community sentiment.

Node Configuration

Authentication

Select your Anysite API credentials from the dropdown or create new ones.

Available Operations

Search Posts

Search for Reddit posts across all subreddits or within specific communities.

Parameters:

Example Output:

{
  "posts": [
    {
      "id": "post123",
      "title": "How to build scalable web applications",
      "text": "Here's what I learned after building 10+ web apps...",
      "subreddit": "webdev",
      "author": "experienced_dev",
      "score": 245,
      "upvoteRatio": 0.92,
      "comments": 67,
      "created": "2024-08-26T10:30:00Z",
      "url": "https://reddit.com/r/webdev/comments/abc123/"
    }
  ]
}

Get Post Comments

Extract comments and discussion threads from a specific Reddit post.

Parameters:

Example Output:

{
  "comments": [
    {
      "id": "comment456",
      "text": "Great points! I'd also add that caching is crucial...",
      "author": "cache_expert",
      "score": 89,
      "created": "2024-08-26T11:15:00Z",
      "replies": [
        {
          "id": "reply789",
          "text": "Absolutely! Redis has been a game changer for us.",
          "author": "redis_fan",
          "score": 34
        }
      ]
    }
  ]
}

Get Subreddit Info

Get information and statistics about a specific subreddit.

Parameters:

Example Output:

{
  "subreddit": {
    "name": "MachineLearning",
    "title": "Machine Learning",
    "description": "This subreddit is dedicated to the discussion of machine learning...",
    "subscribers": 2500000,
    "activeUsers": 5420,
    "created": "2008-01-25T12:00:00Z",
    "isNsfw": false,
    "rules": [
      {
        "title": "Stay on topic",
        "description": "Posts must be related to machine learning"
      }
    ]
  }
}

Monitor Hot Posts

Get currently trending/hot posts from specified subreddits.

Parameters:

Example Output:

{
  "hotPosts": [
    {
      "subreddit": "technology",
      "title": "New AI breakthrough announced by researchers",
      "score": 8750,
      "comments": 432,
      "trending": true,
      "hotnessRank": 1
    }
  ]
}

Workflow Examples

Brand Monitoring

Monitor Mentions

Search for posts mentioning your brand, product, or competitors across relevant subreddits.

Analyze Sentiment

Use AI nodes to analyze sentiment and identify positive/negative discussions.

Track Engagement

Monitor upvotes, comments, and discussion activity around your brand.

Alert Team

Send notifications for high-impact mentions or negative sentiment.

Example Workflow:

{
  "nodes": [
    {
      "name": "Monitor Brand Mentions",
      "type": "@horizondatawave/n8n-nodes-anysite.Reddit",
      "operation": "searchPosts",
      "parameters": {
        "query": "YourBrand OR YourProduct",
        "subreddit": "technology,startups,entrepreneur",
        "sort": "new",
        "limit": 50
      }
    },
    {
      "name": "Filter High Engagement",
      "type": "n8n-nodes-base.filter",
      "parameters": {
        "conditions": [
          {
            "field": "score",
            "operation": "greaterThan",
            "value": 10
          },
          {
            "field": "comments",
            "operation": "greaterThan", 
            "value": 5
          }
        ]
      }
    },
    {
      "name": "Get Comments",
      "type": "@horizondatawave/n8n-nodes-anysite.Reddit",
      "operation": "getPostComments",
      "parameters": {
        "postUrl": "={{ $json.url }}",
        "commentDepth": 2,
        "limit": 25
      }
    },
    {
      "name": "Analyze Sentiment",
      "type": "n8n-nodes-base.openAi",
      "parameters": {
        "prompt": "Analyze sentiment of this Reddit discussion: {{ $json.title }} - {{ $json.text }}"
      }
    }
  ]
}

Market Research

Research customer opinions and market trends:

  1. Industry Monitoring - Track discussions in industry-specific subreddits
  2. Product Feedback - Find mentions of your product or competitors
  3. Feature Requests - Identify commonly requested features or pain points
  4. Trend Analysis - Analyze trending topics and emerging technologies
  5. Report Generation - Create weekly market research reports

Community Management

Monitor and engage with your community:

  1. Support Questions - Find users asking for help with your product
  2. Bug Reports - Identify and track bug reports from users
  3. Feature Discussions - Monitor discussions about new features
  4. Community Health - Track sentiment and engagement in your subreddit
  5. Moderation Alerts - Get notified about posts needing attention

Advanced Search

Search Operators

Use Reddit's search syntax for precise queries:

// Exact title match
{
  "query": "title:\"How to learn machine learning\""
}

// Author search
{
  "query": "author:specific_username"
}

// Multiple subreddits
{
  "query": "subreddit:MachineLearning OR subreddit:programming"
}

// URL search
{
  "query": "url:github.com"
}

// Flair search
{
  "query": "flair:Discussion"
}

// Self posts only
{
  "query": "self:yes machine learning tutorial"
}

// Score filter
{
  "query": "score:>100 artificial intelligence"
}

Time-based Analysis

Track discussions over time:

{
  "name": "Weekly Trend Analysis",
  "type": "@horizondatawave/n8n-nodes-anysite.Reddit", 
  "operation": "searchPosts",
  "parameters": {
    "query": "artificial intelligence",
    "subreddit": "MachineLearning",
    "sort": "top",
    "timeRange": "week",
    "limit": 100
  }
}

Data Analysis

Engagement Metrics

Calculate post and comment engagement:

// Engagement rate calculation
{
  "engagementRate": "={{ ($json.comments / ($json.score || 1)) * 100 }}"
}

// Controversy score
{
  "controversyScore": "={{ (1 - $json.upvoteRatio) * 100 }}"
}

// Discussion density
{
  "discussionDensity": "={{ $json.comments / Math.max($json.text.length / 100, 1) }}"
}

Content Analysis

Extract insights from Reddit content:

{
  "name": "Extract Keywords",
  "type": "n8n-nodes-base.function",
  "parameters": {
    "functionCode": `
      const text = $input.first().json.text.toLowerCase();
      const keywords = text.match(/\\b\\w{4,}\\b/g) || [];
      const wordCount = {};
      
      keywords.forEach(word => {
        wordCount[word] = (wordCount[word] || 0) + 1;
      });
      
      const topKeywords = Object.entries(wordCount)
        .sort(([,a], [,b]) => b - a)
        .slice(0, 10)
        .map(([word, count]) => ({ word, count }));
        
      return [{ json: { ...item.json, topKeywords } }];
    `
  }
}

Error Handling

Common Errors

Subreddit Not Found

Error: 404 - Subreddit not found

Solution:

Post Deleted

Error: 404 - Post not found

Solution:

Rate Limit Hit

Error: 429 - Too many requests

Solution:

Robust Error Handling

{
  "name": "Reddit with Error Handling",
  "type": "@horizondatawave/n8n-nodes-anysite.Reddit",
  "continueOnFail": true,
  "retryOnFail": true,
  "maxTries": 3,
  "waitBetweenTries": 3000,
  "parameters": {
    "operation": "searchPosts",
    "query": "your search query"
  }
}

Integration Examples

Slack Notifications

Send alerts for important discussions:

{
  "name": "High-Impact Alert",
  "type": "n8n-nodes-base.slack",
  "parameters": {
    "channel": "#marketing",
    "text": "šŸ”„ Trending Reddit post about {{ $json.title }}\nšŸ“Š Score: {{ $json.score }} | šŸ’¬ Comments: {{ $json.comments }}\nšŸ”— {{ $json.url }}"
  }
}

Database Storage

Store Reddit data for analysis:

{
  "name": "Store in Database",
  "type": "n8n-nodes-base.postgres",
  "parameters": {
    "operation": "insert",
    "table": "reddit_posts",
    "columns": [
      "post_id",
      "title", 
      "subreddit",
      "score",
      "comments",
      "created_at"
    ],
    "values": [
      "={{ $json.id }}",
      "={{ $json.title }}",
      "={{ $json.subreddit }}",
      "={{ $json.score }}",
      "={{ $json.comments }}",
      "={{ $json.created }}"
    ]
  }
}

Content Aggregation

Combine Reddit data with other sources:

{
  "workflow": [
    "Reddit Search → Get Hot Posts",
    "Twitter Search → Find Related Tweets",
    "Google News → Get News Articles",
    "AI Analysis → Extract Common Themes",
    "Report Generation → Create Daily Brief"
  ]
}

Performance Tips

Efficient Bulk Operations

{
  "name": "Batch Subreddit Monitor",
  "type": "n8n-nodes-base.splitInBatches",
  "parameters": {
    "batchSize": 5,
    "options": {
      "reset": false
    }
  }
}

Data Deduplication

Remove duplicate posts:

// Deduplicate by post ID
{
  "name": "Remove Duplicates",
  "type": "n8n-nodes-base.removeDuplicates",
  "parameters": {
    "compare": "selectedFields",
    "fieldsToCompare": ["id"]
  }
}

Community Insights

Subreddit Analysis

Analyze subreddit health and trends:

{
  "name": "Subreddit Health Check",
  "type": "@horizondatawave/n8n-nodes-anysite.Reddit",
  "operation": "getSubredditInfo",
  "parameters": {
    "subredditName": "{{ $json.subreddit }}",
    "includeRules": true,
    "includeModerators": false
  }
}

Discussion Quality

Assess discussion quality metrics:

// Calculate discussion quality score
{
  "qualityScore": "={{ (($json.score * 0.4) + ($json.comments * 0.3) + (($json.upvoteRatio - 0.5) * 200 * 0.3)) }}"
}

Next Steps