Skip to content

Commit a5d2011

Browse files
author
UnitBytes
committed
chore: sync Python SDK scripts, 9-node n8n workflows & verified schemas
1 parent 23906fd commit a5d2011

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This repository contains ready-to-run **Python SDK scripts**, **9-node n8n autom
4242
| **Reddit Search Scraper: Brand Monitoring & B2B Leads**<br><sub>[`unitbytes/reddit-search-scraper`](https://apify.com/unitbytes/reddit-search-scraper?fpr=939u3w&fp_sid=gh_reddit) • [Full Schema](https://unitbytes.com/actors/reddit-search-scraper/) • [Engineering Playbook](https://unitbytes.com/blog/reddit-api-alternatives-pricing-guide/)</sub> | [`examples/run_reddit_search_scraper.py`](examples/run_reddit_search_scraper.py) | [`n8n/reddit-search-scraper-n8n-workflow.json`](n8n/reddit-search-scraper-n8n-workflow.json) | [`JSON`](samples/reddit-search-scraper-sample.json) · [`CSV`](samples/reddit-search-scraper-sample.csv) | [⚡ **Run on Apify**](https://apify.com/unitbytes/reddit-search-scraper?fpr=939u3w&fp_sid=gh_reddit) |
4343
| **Reddit Comments Scraper: Comment Trees, Replies & Sentiment**<br><sub>[`unitbytes/reddit-comments-scraper`](https://apify.com/unitbytes/reddit-comments-scraper?fpr=939u3w&fp_sid=gh_reddit) • [Full Schema](https://unitbytes.com/actors/reddit-comments-scraper/) • [Engineering Playbook](https://unitbytes.com/blog/reddit-api-alternatives-pricing-guide/)</sub> | [`examples/run_reddit_comments_scraper.py`](examples/run_reddit_comments_scraper.py) | [`n8n/reddit-comments-scraper-n8n-workflow.json`](n8n/reddit-comments-scraper-n8n-workflow.json) | [`JSON`](samples/reddit-comments-scraper-sample.json) · [`CSV`](samples/reddit-comments-scraper-sample.csv) | [⚡ **Run on Apify**](https://apify.com/unitbytes/reddit-comments-scraper?fpr=939u3w&fp_sid=gh_reddit) |
4444
| **Reddit Subreddit Scraper: Hot Posts & Subreddits**<br><sub>[`unitbytes/reddit-subreddits-scraper`](https://apify.com/unitbytes/reddit-subreddits-scraper?fpr=939u3w&fp_sid=gh_reddit) • [Full Schema](https://unitbytes.com/actors/reddit-subreddits-scraper/) • [Engineering Playbook](https://unitbytes.com/blog/reddit-api-alternatives-pricing-guide/)</sub> | [`examples/run_reddit_subreddits_scraper.py`](examples/run_reddit_subreddits_scraper.py) | [`n8n/reddit-subreddits-scraper-n8n-workflow.json`](n8n/reddit-subreddits-scraper-n8n-workflow.json) | [`JSON`](samples/reddit-subreddits-scraper-sample.json) · [`CSV`](samples/reddit-subreddits-scraper-sample.csv) | [⚡ **Run on Apify**](https://apify.com/unitbytes/reddit-subreddits-scraper?fpr=939u3w&fp_sid=gh_reddit) |
45+
| **Reddit Community, Post, Comment & 5-Tab Search Synchronous REST API (`<500ms` GET)**<br><sub>[RapidAPI Hub](https://rapidapi.com/unitbytes/api/reddit-community-post-comment-search-data-api) • [Zyla API Hub](https://zylalabs.com/api-marketplace/social+media+%26+networking/reddit+community+post+comment+and+search+data+api/14529) • [Full Schema](https://unitbytes.com/actors/reddit-scraper/)</sub> | [`examples/run_reddit_rapidapi.py`](examples/run_reddit_rapidapi.py) | [`n8n/reddit-scraper-n8n-workflow.json`](n8n/reddit-scraper-n8n-workflow.json) | [`JSON`](samples/reddit-scraper-sample.json) · [`CSV`](samples/reddit-scraper-sample.csv) | [⚡ **RapidAPI**](https://rapidapi.com/unitbytes/api/reddit-community-post-comment-search-data-api) · [⚡ **Zyla**](https://zylalabs.com/api-marketplace/social+media+%26+networking/reddit+community+post+comment+and+search+data+api/14529) |
4546

4647
- 🤖 **Cursor, Windsurf & Claude Code MCP Ready:** Includes [`.cursor/mcp.json`](.cursor/mcp.json) pre-configured with `https://mcp.apify.com` so AI coding agents can invoke these UnitBytes scrapers natively.
4748
- 💡 **Using n8n?** Explore our official creator profile at **[n8n.io/creators/unitbytes](https://n8n.io/creators/unitbytes/)** or copy all 39 pre-built 9-node scraping workflows (`Ctrl+V`) at **[unitbytes.com/n8n](https://unitbytes.com/n8n/)**.
@@ -97,6 +98,22 @@ Scrape Reddit posts, subreddits, comments, user profiles & HD media without API
9798
| `proxyConfiguration` | `object` | `{"useApifyProxy": true, "apifyProxyGroups": ["RE` | Residential proxy configuration. Reddit blocks datacenter IPs, so residential proxies are automatically enforced by default for high reliability. |
9899
| `customProxyUrl` | `string` | — | Optional custom residential proxy URL (e.g. MrScraper). If provided, it will be prioritized before falling back to Apify Residential. |
99100

101+
#### ⚡ Real-Time Synchronous REST API (RapidAPI Hub & Zyla API Hub — `<500ms` GET)
102+
103+
Need **instant synchronous `GET` JSON responses (`<500ms` live / `<150ms` cached)** for an AI RAG grounding pipeline, brand monitoring webhook, or social listening dashboard? Use our **5-Endpoint Reddit Community, Post, Comment & Search REST API**:
104+
105+
- 👉 **[Test Live on RapidAPI Hub (`$0` Free Tier)](https://rapidapi.com/unitbytes/api/reddit-community-post-comment-search-data-api)** (`x-rapidapi-host: reddit-community-post-comment-search-data-api.p.rapidapi.com`)
106+
- 👉 **[Test Live on Zyla API Hub (7-Day Free Trial)](https://zylalabs.com/api-marketplace/social+media+%26+networking/reddit+community+post+comment+and+search+data+api/14529)** (Listing ID `14529`)
107+
- 🐍 **Runnable Python Script:** [`examples/run_reddit_rapidapi.py`](examples/run_reddit_rapidapi.py)
108+
109+
| Category | Endpoint | Method | Description |
110+
| :--- | :--- | :---: | :--- |
111+
| **1. Discussion Search** | `/v1/reddit/search` | `GET` | Search Reddit posts across all of Reddit or within a specific `subreddit` with `sort` (`relevance`, `hot`, `top`, `new`, `comments`), `time_range` (`hour`, `day`, `week`, `month`, `year`, `all`), and cursor pagination. |
112+
| **2. Subreddit Feed** | `/v1/reddit/subreddit` | `GET` | Fetch live community feed posts (`hot`, `new`, `top`, `rising`) AND community metadata (subscribers, active users, description, rules) for any `subreddit`. |
113+
| **3. Post & Top Comments** | `/v1/reddit/post` | `GET` | Retrieve full post markdown, media attachments, upvote ratio, awards, and top-level discussion tree by `post_id` or Reddit `url`. |
114+
| **4. Comment Tree & Sentiment** | `/v1/reddit/comments` | `GET` | Extract structured multi-depth nested comment trees (`depth`, `sort`) with author flair, scores, and discussion sentiment signals. |
115+
| **5. User Profile Overview** | `/v1/reddit/user` | `GET` | Fetch public Redditor profile (`username`), post/comment karma breakdown, account age, and recent submitted posts & comments. |
116+
100117
#### Python SDK Quickstart (`examples/run_reddit_scraper.py`)
101118
```python
102119
from apify_client import ApifyClient

‎examples/run_reddit_rapidapi.py‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Reddit Community, Post, Comment & Search Data — Real-Time Synchronous REST API Quickstart (RapidAPI Hub & Zyla API Hub)
4+
RapidAPI Hub: https://rapidapi.com/unitbytes/api/reddit-community-post-comment-search-data-api
5+
Zyla API Hub: https://zylalabs.com/api-marketplace/social+media+%26+networking/reddit+community+post+comment+and+search+data+api/14529
6+
Docs & Schema: https://unitbytes.com/actors/reddit-scraper/
7+
8+
Usage:
9+
pip install requests
10+
export RAPIDAPI_KEY="your_rapidapi_key"
11+
python examples/run_reddit_rapidapi.py
12+
"""
13+
14+
import os
15+
import requests
16+
17+
RAPIDAPI_KEY = os.getenv("RAPIDAPI_KEY", "YOUR_RAPIDAPI_KEY")
18+
if not RAPIDAPI_KEY or RAPIDAPI_KEY.startswith("YOUR_"):
19+
raise SystemExit("Please set your RapidAPI key: export RAPIDAPI_KEY='your_rapidapi_key'")
20+
21+
BASE_URL = "https://reddit-community-post-comment-search-data-api.p.rapidapi.com"
22+
HEADERS = {
23+
"x-rapidapi-host": "reddit-community-post-comment-search-data-api.p.rapidapi.com",
24+
"x-rapidapi-key": RAPIDAPI_KEY,
25+
}
26+
27+
# 1. Search Reddit across 5 tabs (posts, communities, people, media, comments)
28+
resp = requests.get(
29+
f"{BASE_URL}/v1/reddit/search",
30+
headers=HEADERS,
31+
params={"query": "python", "tab": "posts", "sort": "relevance", "limit": 5},
32+
timeout=30,
33+
)
34+
resp.raise_for_status()
35+
items = resp.json().get("data", {}).get("items", [])
36+
print(f"Found {len(items)} Reddit posts:")
37+
for post in items[:3]:
38+
print(f" - [{post.get('subreddit')}] {post.get('title')} (Score: {post.get('score')})")

0 commit comments

Comments
 (0)