
Social Media Trends Research
- 632 installs
- 5 repo stars
- Updated June 18, 2026
- drshailesh88/integrated_content_os
social-media-trends-research is a Claude skill that scrapes Reddit public JSON search endpoints to spot trending topics and audience pain for developers who validate content or product angles before writing.
About
social-media-trends-research is a Claude skill built around a SimpleRedditScraper Python class that queries Reddit's public `.json` API endpoints without API keys or authentication. It uses requests with a browser User-Agent header, rate-limited GET calls to reddit.com URLs, and structured parsing of search results to surface trending discussions and pain points. Developers reach for social-media-trends-research during early research when deciding blog topics, developer marketing angles, or feature hypotheses grounded in community chatter. The skill suits quick trend reconnaissance from coding agents rather than enterprise social listening platforms. It requires network access and respectful rate limiting when hitting Reddit's public endpoints.
- SimpleRedditScraper class against Reddit public .json endpoints—no API keys or OAuth
- search() with query, limit (up to 100), sort (relevance/hot/top/new/comments), and time_filter (hour through all)
- Built-in rate limiting via _make_request with User-Agent header and 10s timeout
- Returns normalized post lists or structured error payloads for agent follow-up
Social Media Trends Research by the numbers
- 632 all-time installs (skills.sh)
- Ranked #668 of 1,879 Marketing & SEO skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/drshailesh88/integrated_content_os --skill social-media-trends-researchAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 632 |
|---|---|
| repo stars | ★ 5 |
| Security audit | 2 / 3 scanners passed |
| Last updated | June 18, 2026 |
| Repository | drshailesh88/integrated_content_os ↗ |
How do you research Reddit trends without API keys?
Scrape Reddit’s public JSON search to spot trending topics and audience pain before you commit to content or product angles.
Who is it for?
Developers and technical marketers doing early Reddit trend research without Reddit API credentials or paid social listening tools.
Skip if: Enterprise social analytics, authenticated Reddit API workflows, or production crawlers that ignore rate limits.
When should I use this skill?
The user wants to discover Reddit trending topics, community pain points, or content angles using public JSON search before writing or building.
What you get
Reddit search result datasets, trending topic lists, and audience pain summaries from public JSON endpoints.
- trending topic list
- reddit search result dataset
Files
Social Media Trends Research
Overview
Programmatic trend research using three free tools:
- pytrends: Google Trends data (velocity, volume, related queries)
- yars: Reddit scraping without API keys
- Perplexity MCP: Twitter/TikTok/Web trends (via Claude's built-in MCP)
This skill provides executable code for trend research. Use alongside content-marketing-social-listening for strategy and perplexity-search for deep queries.
Quick Setup
# Install dependencies (one-time)
pip install pytrends requests --break-system-packagesNo API keys required. Reddit scraping uses public .json endpoints.
---
Tool 1: pytrends (Google Trends)
What It Provides
- Real-time trending searches by country
- Interest over time for keywords
- Related queries (rising = velocity indicators)
- Interest by region
- Related topics
Basic Usage
from pytrends.request import TrendReq
import time
# Initialize (no API key needed)
pytrends = TrendReq(hl='en-US', tz=330) # tz=330 for India (IST)
# Get real-time trending searches
trending = pytrends.trending_searches(pn='india')
print(trending.head(20))Research Your Niche Keywords
from pytrends.request import TrendReq
import time
pytrends = TrendReq(hl='en-US', tz=330)
# Define your niche keywords (max 5 per request)
keywords = ['heart health', 'cardiology', 'cholesterol']
# Build payload
pytrends.build_payload(keywords, timeframe='now 7-d', geo='IN')
# Get interest over time
interest = pytrends.interest_over_time()
print(interest)
# CRITICAL: Wait between requests to avoid rate limiting
time.sleep(3)
# Get related queries (THIS IS GOLD - shows rising topics)
related = pytrends.related_queries()
for kw in keywords:
print(f"\n=== Rising queries for '{kw}' ===")
rising = related[kw]['rising']
if rising is not None:
print(rising.head(10))Find Viral/Breakout Topics
from pytrends.request import TrendReq
import time
pytrends = TrendReq(hl='en-US', tz=330)
def find_breakout_topics(keyword, geo=''):
"""Find topics with explosive growth (potential viral content)"""
pytrends.build_payload([keyword], timeframe='today 3-m', geo=geo)
time.sleep(3) # Rate limiting
related = pytrends.related_queries()
rising = related[keyword]['rising']
if rising is not None:
# Filter for breakout topics (marked as "Breakout" or very high %)
breakouts = rising[rising['value'] >= 1000] # 1000%+ growth
return breakouts
return None
# Example usage
breakouts = find_breakout_topics('heart health', geo='IN')
print(breakouts)Rate Limiting Rules for pytrends
import time
# SAFE: 1 request per 3-5 seconds for casual use
time.sleep(5)
# BULK RESEARCH: 1 request per 60 seconds
time.sleep(60)
# If you get rate limited (429 error): Wait 60-120 seconds, then continue
# If persistent issues: Wait 4-6 hours before resumingUseful Timeframes
| Timeframe | Use Case |
|---|---|
'now 1-H' | Last hour (real-time spikes) |
'now 4-H' | Last 4 hours |
'now 1-d' | Last 24 hours |
'now 7-d' | Last 7 days (best for trends) |
'today 1-m' | Last 30 days |
'today 3-m' | Last 90 days (velocity analysis) |
'today 12-m' | Last year (seasonal patterns) |
---
Tool 2: Reddit (No API Keys - Public JSON Endpoints)
What It Provides
- Search Reddit for any keyword
- Get hot/top/rising posts from subreddits
- Post engagement data (upvotes, comments)
- No authentication required
Basic Usage
import requests
import time
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
# Search Reddit for your niche
url = "https://www.reddit.com/search.json?q=heart+health&limit=10&sort=relevance&t=week"
response = requests.get(url, headers=headers, timeout=10)
data = response.json()
# Display results
for child in data.get('data', {}).get('children', []):
post = child.get('data', {})
print(f"Title: {post.get('title')}")
print(f"Subreddit: r/{post.get('subreddit')}")
print(f"Score: {post.get('score')}")
print("---")Get Hot Posts from Specific Subreddits
import requests
import time
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
# Define subreddits relevant to your niche
subreddits = ['cardiology', 'health', 'medicine']
for sub in subreddits:
print(f"\n=== Hot in r/{sub} ===")
try:
url = f"https://www.reddit.com/r/{sub}/hot.json?limit=10"
response = requests.get(url, headers=headers, timeout=10)
data = response.json()
for child in data.get('data', {}).get('children', [])[:5]:
post = child.get('data', {})
print(f"- [{post.get('score')}] {post.get('title')[:60]}...")
except Exception as e:
print(f"Error: {e}")
time.sleep(3) # Rate limiting between requestsUsing the Bundled Reddit Scraper
A helper class is included in scripts/reddit_scraper.py:
from scripts.reddit_scraper import SimpleRedditScraper
scraper = SimpleRedditScraper()
# Search
results = scraper.search("heart health tips", limit=20)
for post in results['posts']:
print(f"[{post['score']}] r/{post['subreddit']}: {post['title']}")
# Get subreddit hot posts
results = scraper.get_subreddit("health", sort="hot", limit=10)
for post in results['posts']:
print(f"[{post['score']}] {post['title']}")Rate Limiting Rules for Reddit
import time
# SAFE: 1 request per 2-3 seconds
time.sleep(3)
# If you get 429 errors: Wait 5-10 minutes
# Never do more than 60 requests per hour---
Tool 3: Perplexity MCP (Twitter/TikTok/Web)
Use Claude's built-in Perplexity MCP for platforms you can't scrape directly.
Query Templates for Trend Research
Twitter/X Trends:
"What are the most discussed [YOUR NICHE] topics on Twitter/X this week?
Include specific examples of viral tweets and their engagement."TikTok Trends (works from India):
"What [YOUR NICHE] content is trending on TikTok right now?
Include hashtags, view counts, and content formats that are working."YouTube Trends:
"What [YOUR NICHE] videos are getting the most views on YouTube this week?
Include channel names, view counts, and video topics."LinkedIn Professional:
"What [YOUR NICHE] topics are professionals discussing on LinkedIn this week?
Include examples of high-engagement posts."General Viral Content:
"What [YOUR NICHE] content has gone viral across social media in the past 7 days?
Include platform, format, and why it resonated."Using Perplexity with perplexity-search Skill
If you have the perplexity-search skill installed:
python scripts/perplexity_search.py \
"What cardiology topics are trending on Twitter and TikTok this week? Include specific viral posts and hashtags." \
--model sonar-pro---
Combined Research Workflow
Complete Trend Research Function
from pytrends.request import TrendReq
import requests
import time
import json
from datetime import datetime
class TrendResearcher:
def __init__(self):
self.pytrends = TrendReq(hl='en-US', tz=330)
self.reddit_headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
def _reddit_request(self, url):
"""Make a Reddit API request."""
try:
response = requests.get(url, headers=self.reddit_headers, timeout=10)
response.raise_for_status()
return response.json()
except Exception as e:
return {'error': str(e)}
def research_niche(self, keywords, subreddits=None, geo='IN'):
"""
Complete trend research for a niche.
Args:
keywords: List of keywords (max 5)
subreddits: List of subreddit names to monitor
geo: Geographic region code
Returns:
Dictionary with all research data
"""
results = {
'timestamp': datetime.now().isoformat(),
'keywords': keywords,
'google_trends': {},
'reddit': {},
'recommendations': []
}
# 1. Google Trends - Interest Over Time
print("📊 Fetching Google Trends data...")
try:
self.pytrends.build_payload(keywords[:5], timeframe='now 7-d', geo=geo)
results['google_trends']['interest'] = self.pytrends.interest_over_time().to_dict()
time.sleep(5)
# Related queries (rising topics)
related = self.pytrends.related_queries()
results['google_trends']['rising_queries'] = {}
for kw in keywords[:5]:
rising = related[kw]['rising']
if rising is not None:
results['google_trends']['rising_queries'][kw] = rising.head(10).to_dict()
time.sleep(5)
except Exception as e:
results['google_trends']['error'] = str(e)
# 2. Reddit Research
print("👽 Fetching Reddit discussions...")
if subreddits:
for sub in subreddits[:5]:
try:
url = f"https://www.reddit.com/r/{sub}/hot.json?limit=10"
data = self._reddit_request(url)
posts = []
for child in data.get('data', {}).get('children', [])[:5]:
post = child.get('data', {})
posts.append({
'title': post.get('title', ''),
'score': post.get('score', 0),
'comments': post.get('num_comments', 0)
})
results['reddit'][sub] = posts
time.sleep(3)
except Exception as e:
results['reddit'][sub] = {'error': str(e)}
# 3. Keyword search on Reddit
print("🔍 Searching Reddit for keywords...")
for kw in keywords[:3]:
try:
url = f"https://www.reddit.com/search.json?q={kw}&limit=10&sort=relevance&t=week"
data = self._reddit_request(url)
posts = []
for child in data.get('data', {}).get('children', [])[:5]:
post = child.get('data', {})
posts.append({
'title': post.get('title', ''),
'subreddit': post.get('subreddit', ''),
'score': post.get('score', 0),
'comments': post.get('num_comments', 0)
})
results['reddit'][f'search_{kw}'] = posts
time.sleep(3)
except Exception as e:
results['reddit'][f'search_{kw}'] = {'error': str(e)}
# 4. Generate recommendations
results['recommendations'] = self._generate_recommendations(results)
return results
def _generate_recommendations(self, data):
"""Generate content recommendations from research data"""
recommendations = []
# From rising queries
rising = data.get('google_trends', {}).get('rising_queries', {})
for kw, queries in rising.items():
if isinstance(queries, dict) and 'query' in queries:
for query in list(queries['query'].values())[:3]:
recommendations.append({
'source': 'Google Trends',
'topic': query,
'reason': f"Rising search term related to '{kw}'"
})
# From Reddit hot posts
for sub, posts in data.get('reddit', {}).items():
if isinstance(posts, list):
for post in posts[:2]:
if post.get('score', 0) > 50:
recommendations.append({
'source': f'Reddit r/{sub}',
'topic': post.get('title', ''),
'reason': f"High engagement ({post.get('score')} upvotes)"
})
return recommendations
# Usage Example
if __name__ == "__main__":
researcher = TrendResearcher()
results = researcher.research_niche(
keywords=['heart health', 'cardiology', 'cholesterol'],
subreddits=['cardiology', 'health', 'medicine'],
geo='IN'
)
# Save results
with open('trend_research.json', 'w') as f:
json.dump(results, f, indent=2, default=str)
# Print recommendations
print("\n🎯 CONTENT RECOMMENDATIONS:")
for rec in results['recommendations']:
print(f"- [{rec['source']}] {rec['topic']}")
print(f" Why: {rec['reason']}")---
Quick Reference Commands
Daily Trend Check (5 minutes)
from pytrends.request import TrendReq
import requests
import time
# Quick Google Trends check
pytrends = TrendReq(hl='en-US', tz=330)
pytrends.build_payload(['your keyword'], timeframe='now 1-d')
print(pytrends.related_queries()['your keyword']['rising'])
time.sleep(5)
# Quick Reddit check
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
url = "https://www.reddit.com/search.json?q=your+keyword&limit=10&t=day"
response = requests.get(url, headers=headers, timeout=10)
data = response.json()
for child in data.get('data', {}).get('children', [])[:5]:
post = child.get('data', {})
print(f"[{post.get('score')}] {post.get('title')}")Weekly Deep Dive
# Use the TrendResearcher class above with:
# - 5 core keywords
# - 5 relevant subreddits
# - 90-day timeframe for velocity analysis
# Then use Perplexity MCP for:
# - Twitter trends in your niche
# - TikTok viral content
# - YouTube trending videos
# - LinkedIn discussions---
Integration with Writing Skills
After research, pass findings to your writing skills:
1. Run trend research (this skill)
2. Identify top 3-5 opportunities
3. Use content-marketing-social-listening for strategy
4. Use cardiology-content-repurposer or similar for content creation
5. Use authentic-voice for final polish---
Troubleshooting
pytrends Issues
| Error | Solution |
|---|---|
| 429 Too Many Requests | Wait 60 seconds, then increase sleep time |
| Empty results | Check if keyword has search volume |
| Connection error | Check internet, retry in 5 minutes |
Reddit Issues
| Error | Solution |
|---|---|
| 429 Rate Limited | Wait 10 minutes |
| Subreddit not found | Check subreddit name spelling |
| Empty results | Subreddit may be private or quarantined |
| Connection timeout | Increase timeout, check internet |
---
Best Practices
1. Always use rate limiting: Sleep between requests 2. Research in batches: Do weekly deep dives, not constant polling 3. Save results: Cache research data locally 4. Cross-reference: Validate trends across multiple platforms 5. Act fast: Viral windows are short (24-72 hours)
---
Platform Coverage Summary
| Platform | Tool | Cost | Risk |
|---|---|---|---|
| Google Trends | pytrends | Free | Very Low |
| requests (public JSON) | Free | Low | |
| Twitter/X | Perplexity MCP | Free* | None |
| TikTok | Perplexity MCP | Free* | None |
| YouTube | Perplexity MCP | Free* | None |
| Perplexity MCP | Free* | None |
*Uses Claude's built-in MCP or OpenRouter credits if using perplexity-search skill
---
Bundled Resources
scripts/trend_research.py: Main CLI tool for complete trend researchscripts/reddit_scraper.py: Simple Reddit scraper class (no API keys)
"""
Simple Reddit Scraper - No API Keys Required
=============================================
Uses Reddit's public .json API endpoints.
No authentication needed.
"""
import requests
import time
class SimpleRedditScraper:
"""Simple Reddit scraper using public .json endpoints."""
def __init__(self):
self.headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
self.base_url = 'https://www.reddit.com'
def _make_request(self, url):
"""Make a request with rate limiting."""
try:
response = requests.get(url, headers=self.headers, timeout=10)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
return {'error': str(e)}
def search(self, query, limit=25, sort='relevance', time_filter='week'):
"""
Search Reddit for a query.
Args:
query: Search term
limit: Max results (up to 100)
sort: 'relevance', 'hot', 'top', 'new', 'comments'
time_filter: 'hour', 'day', 'week', 'month', 'year', 'all'
Returns:
List of post dictionaries
"""
url = f"{self.base_url}/search.json?q={query}&limit={limit}&sort={sort}&t={time_filter}"
data = self._make_request(url)
if 'error' in data:
return {'posts': [], 'error': data['error']}
posts = []
for child in data.get('data', {}).get('children', []):
post = child.get('data', {})
posts.append({
'title': post.get('title', ''),
'subreddit': post.get('subreddit', ''),
'score': post.get('score', 0),
'num_comments': post.get('num_comments', 0),
'url': f"https://reddit.com{post.get('permalink', '')}",
'created_utc': post.get('created_utc', 0),
'selftext': post.get('selftext', '')[:200] # First 200 chars
})
return {'posts': posts}
def get_subreddit(self, subreddit, sort='hot', limit=25, time_filter='week'):
"""
Get posts from a subreddit.
Args:
subreddit: Subreddit name (without r/)
sort: 'hot', 'new', 'top', 'rising'
limit: Max results
time_filter: For 'top' sort - 'hour', 'day', 'week', 'month', 'year', 'all'
Returns:
List of post dictionaries
"""
if sort == 'top':
url = f"{self.base_url}/r/{subreddit}/top.json?limit={limit}&t={time_filter}"
else:
url = f"{self.base_url}/r/{subreddit}/{sort}.json?limit={limit}"
data = self._make_request(url)
if 'error' in data:
return {'posts': [], 'error': data['error']}
posts = []
for child in data.get('data', {}).get('children', []):
post = child.get('data', {})
posts.append({
'title': post.get('title', ''),
'subreddit': post.get('subreddit', ''),
'score': post.get('score', 0),
'num_comments': post.get('num_comments', 0),
'url': f"https://reddit.com{post.get('permalink', '')}",
'created_utc': post.get('created_utc', 0),
'selftext': post.get('selftext', '')[:200]
})
return {'posts': posts}
def get_trending_subreddits(self):
"""Get popular/trending subreddits."""
url = f"{self.base_url}/subreddits/popular.json?limit=25"
data = self._make_request(url)
if 'error' in data:
return {'subreddits': [], 'error': data['error']}
subreddits = []
for child in data.get('data', {}).get('children', []):
sub = child.get('data', {})
subreddits.append({
'name': sub.get('display_name', ''),
'title': sub.get('title', ''),
'subscribers': sub.get('subscribers', 0),
'description': sub.get('public_description', '')[:100]
})
return {'subreddits': subreddits}
# Quick test
if __name__ == "__main__":
scraper = SimpleRedditScraper()
print("🔍 Testing Reddit Search...")
results = scraper.search("heart health", limit=5)
for post in results.get('posts', []):
print(f" [{post['score']}] r/{post['subreddit']}: {post['title'][:60]}...")
print("\n🔥 Testing Subreddit Hot Posts...")
time.sleep(2) # Rate limiting
results = scraper.get_subreddit("health", sort="hot", limit=5)
for post in results.get('posts', []):
print(f" [{post['score']}] {post['title'][:60]}...")
#!/usr/bin/env python3
"""
Social Media Trends Research Tool
==================================
Programmatic trend research using pytrends (Google Trends) and yars (Reddit).
No API keys required.
Usage:
python trend_research.py --keywords "heart health" "cardiology"
python trend_research.py --keywords "AI" --subreddits "artificial" "MachineLearning"
python trend_research.py --keywords "fitness" --output results.json
python trend_research.py --trending-only # Just show trending searches
"""
import argparse
import json
import time
import sys
from datetime import datetime
def check_dependencies():
"""Check if required packages are installed."""
missing = []
try:
from pytrends.request import TrendReq
except ImportError:
missing.append("pytrends")
try:
import requests
except ImportError:
missing.append("requests")
if missing:
print("❌ Missing dependencies. Install with:")
for pkg in missing:
print(f" pip install {pkg} --break-system-packages")
sys.exit(1)
def get_trending_searches(country='india'):
"""Get real-time trending searches from Google."""
from pytrends.request import TrendReq
pytrends = TrendReq(hl='en-US', tz=330)
trending = pytrends.trending_searches(pn=country)
return trending[0].tolist()[:20]
def get_keyword_data(keywords, timeframe='now 7-d', geo='IN'):
"""Get interest and related queries for keywords."""
from pytrends.request import TrendReq
pytrends = TrendReq(hl='en-US', tz=330)
results = {
'keywords': keywords,
'timeframe': timeframe,
'geo': geo,
'interest_over_time': None,
'rising_queries': {},
'related_topics': {}
}
# Interest over time
print(f"📊 Analyzing: {', '.join(keywords)}")
pytrends.build_payload(keywords[:5], timeframe=timeframe, geo=geo)
try:
interest = pytrends.interest_over_time()
if not interest.empty:
# Get average interest for each keyword
results['interest_over_time'] = {}
for kw in keywords[:5]:
if kw in interest.columns:
results['interest_over_time'][kw] = round(interest[kw].mean(), 2)
except Exception as e:
print(f" ⚠️ Interest data error: {e}")
time.sleep(3)
# Related queries (rising = potential viral topics)
try:
related = pytrends.related_queries()
for kw in keywords[:5]:
rising = related[kw]['rising']
if rising is not None and not rising.empty:
results['rising_queries'][kw] = rising.head(10).to_dict('records')
except Exception as e:
print(f" ⚠️ Related queries error: {e}")
time.sleep(3)
# Related topics
try:
topics = pytrends.related_topics()
for kw in keywords[:5]:
rising = topics[kw]['rising']
if rising is not None and not rising.empty:
results['related_topics'][kw] = rising.head(5).to_dict('records')
except Exception as e:
print(f" ⚠️ Related topics error: {e}")
return results
def search_reddit(keywords, limit=10):
"""Search Reddit for keyword discussions."""
import requests
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
results = {}
for kw in keywords[:3]: # Limit to avoid rate limiting
print(f"👽 Searching Reddit: {kw}")
try:
url = f"https://www.reddit.com/search.json?q={kw}&limit={limit}&sort=relevance&t=week"
response = requests.get(url, headers=headers, timeout=10)
response.raise_for_status()
data = response.json()
results[kw] = []
for child in data.get('data', {}).get('children', []):
post = child.get('data', {})
results[kw].append({
'title': post.get('title', ''),
'subreddit': post.get('subreddit', ''),
'score': post.get('score', 0),
'comments': post.get('num_comments', 0),
'url': f"https://reddit.com{post.get('permalink', '')}"
})
time.sleep(3)
except Exception as e:
print(f" ⚠️ Error searching '{kw}': {e}")
results[kw] = []
return results
def get_subreddit_hot(subreddits, limit=5):
"""Get hot posts from specific subreddits."""
import requests
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'}
results = {}
for sub in subreddits[:5]: # Limit to avoid rate limiting
print(f"🔥 Checking r/{sub}")
try:
url = f"https://www.reddit.com/r/{sub}/hot.json?limit={limit}"
response = requests.get(url, headers=headers, timeout=10)
response.raise_for_status()
data = response.json()
results[sub] = []
for child in data.get('data', {}).get('children', []):
post = child.get('data', {})
results[sub].append({
'title': post.get('title', ''),
'score': post.get('score', 0),
'comments': post.get('num_comments', 0),
'url': f"https://reddit.com{post.get('permalink', '')}"
})
time.sleep(3)
except Exception as e:
print(f" ⚠️ Error with r/{sub}: {e}")
results[sub] = []
return results
def generate_recommendations(google_data, reddit_data):
"""Generate content recommendations from research."""
recommendations = []
# From Google rising queries
for kw, queries in google_data.get('rising_queries', {}).items():
for q in queries[:3]:
if isinstance(q, dict):
recommendations.append({
'source': 'Google Trends',
'topic': q.get('query', ''),
'signal': f"Rising search (+{q.get('value', 0)}%)",
'priority': 'HIGH' if q.get('value', 0) >= 500 else 'MEDIUM'
})
# From Reddit high-engagement posts
for kw, posts in reddit_data.items():
for post in posts[:2]:
if post.get('score', 0) >= 100:
recommendations.append({
'source': f"Reddit (r/{post.get('subreddit', kw)})",
'topic': post.get('title', '')[:80],
'signal': f"High engagement ({post.get('score')} upvotes)",
'priority': 'HIGH' if post.get('score', 0) >= 500 else 'MEDIUM'
})
# Sort by priority
priority_order = {'HIGH': 0, 'MEDIUM': 1, 'LOW': 2}
recommendations.sort(key=lambda x: priority_order.get(x.get('priority', 'LOW'), 2))
return recommendations
def print_report(data):
"""Print a formatted research report."""
print("\n" + "="*60)
print("📈 TREND RESEARCH REPORT")
print("="*60)
print(f"Generated: {data['timestamp']}")
print(f"Keywords: {', '.join(data['keywords'])}")
# Google Trends
if data.get('google_trends', {}).get('interest_over_time'):
print("\n📊 GOOGLE TRENDS - INTEREST LEVELS")
print("-"*40)
for kw, score in data['google_trends']['interest_over_time'].items():
bar = "█" * int(score / 10)
print(f" {kw}: {bar} ({score})")
# Rising Queries
if data.get('google_trends', {}).get('rising_queries'):
print("\n🚀 RISING SEARCH QUERIES (Potential Viral Topics)")
print("-"*40)
for kw, queries in data['google_trends']['rising_queries'].items():
print(f"\n Related to '{kw}':")
for q in queries[:5]:
if isinstance(q, dict):
value = q.get('value', 0)
marker = "🔥" if value >= 500 else "📈"
print(f" {marker} {q.get('query', '')} (+{value}%)")
# Reddit
if data.get('reddit'):
print("\n👽 REDDIT DISCUSSIONS")
print("-"*40)
for source, posts in data['reddit'].items():
if posts:
print(f"\n {source}:")
for post in posts[:3]:
print(f" ↑{post.get('score', 0):4d} | {post.get('title', '')[:50]}...")
# Recommendations
if data.get('recommendations'):
print("\n🎯 CONTENT RECOMMENDATIONS")
print("-"*40)
for i, rec in enumerate(data['recommendations'][:10], 1):
priority_icon = "🔴" if rec['priority'] == 'HIGH' else "🟡"
print(f" {i}. {priority_icon} [{rec['source']}]")
print(f" Topic: {rec['topic']}")
print(f" Signal: {rec['signal']}")
print("\n" + "="*60)
def main():
parser = argparse.ArgumentParser(
description='Social Media Trends Research Tool',
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
python trend_research.py --keywords "heart health" "cardiology"
python trend_research.py --keywords "AI" --subreddits "artificial" "MachineLearning"
python trend_research.py --trending-only
python trend_research.py --keywords "fitness" --output results.json
"""
)
parser.add_argument('--keywords', '-k', nargs='+',
help='Keywords to research (max 5)')
parser.add_argument('--subreddits', '-s', nargs='+',
help='Subreddits to monitor (max 5)')
parser.add_argument('--trending-only', '-t', action='store_true',
help='Only show trending searches')
parser.add_argument('--timeframe', default='now 7-d',
help='Timeframe for Google Trends (default: now 7-d)')
parser.add_argument('--geo', default='IN',
help='Geographic region (default: IN for India)')
parser.add_argument('--output', '-o',
help='Save results to JSON file')
parser.add_argument('--country', default='india',
help='Country for trending searches (default: india)')
args = parser.parse_args()
# Check dependencies
check_dependencies()
# Trending only mode
if args.trending_only:
print("🔥 REAL-TIME TRENDING SEARCHES")
print("-"*40)
trending = get_trending_searches(args.country)
for i, topic in enumerate(trending, 1):
print(f" {i:2d}. {topic}")
return
# Need keywords for full research
if not args.keywords:
parser.print_help()
print("\n❌ Please provide keywords with --keywords")
sys.exit(1)
# Full research
data = {
'timestamp': datetime.now().isoformat(),
'keywords': args.keywords,
'google_trends': {},
'reddit': {},
'recommendations': []
}
# Google Trends
google_data = get_keyword_data(args.keywords, args.timeframe, args.geo)
data['google_trends'] = google_data
# Reddit keyword search
reddit_search = search_reddit(args.keywords)
data['reddit'].update(reddit_search)
# Reddit subreddits (if provided)
if args.subreddits:
subreddit_data = get_subreddit_hot(args.subreddits)
for sub, posts in subreddit_data.items():
data['reddit'][f'r/{sub}'] = posts
# Generate recommendations
data['recommendations'] = generate_recommendations(google_data, data['reddit'])
# Print report
print_report(data)
# Save to file if requested
if args.output:
with open(args.output, 'w') as f:
json.dump(data, f, indent=2, default=str)
print(f"\n💾 Results saved to: {args.output}")
# Reminder about Perplexity
print("\n💡 TIP: For Twitter/TikTok trends, ask Claude to use Perplexity MCP:")
print(" 'What's trending on Twitter about [your niche] this week?'")
if __name__ == "__main__":
main()
Related skills
How it compares
Use social-media-trends-research for quick no-key Reddit scans; use dedicated SEO or analytics skills when you need Search Console or formal keyword volume data.
FAQ
Does social-media-trends-research need Reddit API keys?
social-media-trends-research does not require Reddit API keys. The SimpleRedditScraper class calls Reddit's public `.json` endpoints with a standard User-Agent header and rate-limited HTTP requests, suitable for lightweight trend reconnaissance.
What does social-media-trends-research output?
social-media-trends-research outputs trending discussion topics and audience pain signals parsed from Reddit public JSON search results. Developers use the data to validate content angles or product hypotheses before committing to blog posts or features.
Is Social Media Trends Research safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.