Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reddit-api-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-api-client

Barebones Reddit API client for Node.js

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

reddit-api-client

Barebones Reddit API client for Node.js. Just pass in your credentials and make requests yourself by passing the url and the params needed for the call. https://www.reddit.com/dev/api is your friend, no classes and no sugar included.

usage

npm i reddit-api-client

const RedditClient = require('reddit-api-client');
// insert real credentials below
const r = new RedditClient({
  "redditKey": "XXXXXXXXXXXXXX",
  "redditSecret": "YYYYYYYYYYYYYYYYYYYYYYYYYYY",
  "redditUser": "ZZZZZZZZZZZZZZ",
  "redditPass": "TTTTTTTTTTTTTTTTTTTT",
  "redditUserAgent": "QQQQQQQQQQQQQQ"
});

r.get('/r/node/new', {
  query: {
    limit: 10
  }
}, (err, res) => {
  if (err) { throw err; }

  res.body.data.children.forEach(c => {
    const { data } = c;

    console.log(data);
  });
});

Checkout the /example folders for more examples and advanced usage. Read the source code as well (100ish LOC).

alternatives

If you want a fully-featured JavaScript wrapper for the reddit API use https://github.com/not-an-aardvark/snoowrap instead.

license MIT

https://alessioalex.mit-license.org/

FAQs

Package last updated on 27 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc