
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
npm install reddit
This package is used by BitMidi to post MIDI files to the /r/BitMidi subreddit.
First, create a Reddit App.
Now, let's take an action on Reddit:
const Reddit = require('reddit')
const reddit = new Reddit({
username: 'TODO',
password: 'TODO',
appId: 'TODO',
appSecret: 'TODO',
userAgent: 'MyApp/1.0.0 (http://example.com)'
})
// Submit a link to the /r/BitMidi subreddit
const res = await reddit.post('/api/submit', {
sr: 'WeAreTheMusicMakers',
kind: 'link',
resubmit: true,
title: 'BitMidi – 100K+ Free MIDI files',
url: 'https://bitmidi.com'
})
console.log(res)
// Prints:
// {
// json: {
// errors: [],
// data: {
// url: 'https://www.reddit.com/r/WeAreTheMusicMakers/comments/96ak55/',
// drafts_count: 0,
// id: '96ak55',
// name: 't3_96ak55'
// }
// }
// }
reddit = new Reddit(opts)Create a new Reddit API client.
You must provide opts, an object with the following required properties:
username - Username of the reddit userpassword - Password of the reddit userappId - Reddit App IDappSecret - Reddit App SecretThe following opts properties are optional:
opts.userAgent - String to use as the User-Agent header in http requestsreddit.get(url, [data])Invoke the Reddit API using the GET HTTP method.
The url parameter is used to specify which API to invoke. For example, /api/submit or /api/vote. A complete listing of possible APIs is available in the Reddit API documentation.
The optional data parameter is used to specify relevant data for the selected API. The necessary data varies depending on which API is being used. Again, see the Reddit API documentation.
reddit.post(url, [data])Invoke the Reddit API using the POST HTTP method.
reddit.patch(url, [data])Invoke the Reddit API using the PATCH HTTP method.
reddit.put(url, [data])Invoke the Reddit API using the PUT HTTP method.
reddit.delete(url, [data])Invoke the Reddit API using the DELETE HTTP method.
The Prosperity Public License. Copyright (c) Feross Aboukhadijeh.
To obtain a commercial license, visit feross.org/commercial.
FAQs
Simple Reddit API client
The npm package reddit receives a total of 1,527 weekly downloads. As such, reddit popularity was classified as popular.
We found that reddit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.