Gathering detailed insights and metrics for reddit-fetch-pro
Gathering detailed insights and metrics for reddit-fetch-pro
Gathering detailed insights and metrics for reddit-fetch-pro
Gathering detailed insights and metrics for reddit-fetch-pro
npm install reddit-fetch-pro
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Feb 28, 2025
Latest Version
1.0.0
Package Id
reddit-fetch-pro@1.0.0
Unpacked Size
10.94 kB
Size
4.28 kB
File Count
6
NPM Version
10.8.3
Node Version
20.17.0
Published on
Feb 28, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A modern, lightweight Node.js package for fetching data from Reddit subreddits and user profiles.
1npm install reddit-fetch-pro
Reddit Fetch Pro is a powerful yet simple package for retrieving data from Reddit. It supports fetching posts from both subreddits and user profiles with clean, structured JSON output. Perfect for building Reddit-powered applications, bots, and data analysis tools.
1const reddit = require("reddit-fetch-pro"); 2 3// Get posts from a user profile 4reddit({ 5 search: "spez", // Reddit username 6 limits: 3, // Optional: Number of posts to retrieve 7 type: "user" // Specify user profile fetch 8}) 9.then(response => { 10 console.log(response); 11 /* 12 Output: 13 { 14 data: [ 15 { 16 title: 'Announcing Reddit Talk...', 17 image: 'https://www.reddit.com/r/...', 18 link: 'https://www.reddit.com/r/...', 19 like: 12580, 20 dislike: 0, 21 comment: 4378, 22 subredditName: 'r/reddit', 23 author: 'spez', 24 dateCreated_UTC: 'Feb 25, 2025 3:21 PM', 25 subreddit: 'reddit', 26 id: 'xyz789', 27 voteRatio: 0.87, 28 nsfw: false 29 }, 30 // More posts... 31 ] 32 } 33 */ 34}) 35.catch(error => { 36 console.log(error); 37});
1const reddit = require("reddit-fetch-pro"); 2 3// Get posts from a subreddit 4reddit({ 5 search: "programming", // Subreddit name 6 limits: 5 // Optional: Number of posts to retrieve 7}) 8.then(response => { 9 console.log(response); 10 /* 11 Output: 12 { 13 data: [ 14 { 15 title: 'What programming books had the biggest impact on you?', 16 image: 'https://www.reddit.com/r/programming/comments/...', 17 link: 'https://www.reddit.com/r/programming/comments/...', 18 like: 342, 19 dislike: 0, 20 comment: 127, 21 subredditName: 'r/programming', 22 author: 'username123', 23 dateCreated_UTC: 'Feb 27, 2025 8:45 PM', 24 subreddit: 'programming', 25 id: 'abc123', 26 voteRatio: 0.95, 27 nsfw: false 28 }, 29 // More posts... 30 ] 31 } 32 */ 33}) 34.catch(error => { 35 console.log(error); 36});
1// Get only 2 posts from r/news 2reddit({ 3 search: "news", 4 limits: 2 5}) 6.then(response => { 7 console.log(`Found ${response.data.length} posts`); 8}) 9.catch(error => { 10 console.log(error); 11});
Each post in the response contains the following information:
Field | Type | Description |
---|---|---|
title | String | The title of the post |
image | String | URL of the post's image or content |
link | String | Full permalink to the Reddit post |
like | Number | Upvote count |
dislike | Number | Downvote count |
comment | Number | Comment count |
subredditName | String | Formatted subreddit name (e.g., "r/programming") |
author | String | Username of the post's author |
dateCreated_UTC | String | Human-readable creation date |
subreddit | String | Raw subreddit name |
id | String | Unique Reddit post ID |
voteRatio | Number | Ratio of upvotes to total votes (0.0-1.0) |
nsfw | Boolean | Whether the post is marked NSFW |
Q: Can I use this for commercial projects?
A: Yes! This package is MIT licensed, which allows for commercial use.
Q: Is there a rate limit?
A: This package uses the Reddit public API, which has rate limits. For high-volume applications, consider implementing a delay between requests.
Q: Can I fetch comments?
A: Currently, the package only fetches post data. Comment fetching may be added in future updates.
The package uses promise-based error handling. Always implement a .catch()
block to handle potential errors:
1reddit({ 2 search: "non_existent_subreddit" 3}) 4.then(response => { 5 console.log(response); 6}) 7.catch(error => { 8 console.error("Error occurred:", error.message); 9});
Contributions are welcome! Feel free to submit a pull request or open an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
For bugs, feature requests, or other questions:
No vulnerabilities found.
No security vulnerabilities found.