Socket
Socket
Sign inDemoInstall

pushshift-api

Package Overview
Dependencies
7
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pushshift-api

A pushshift API for Reddit


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
529 kB
Created
Weekly downloads
 

Readme

Source

Reddit PushShift API

An API to query the PushShift Reddit API, supporting both submissions and comments.

PushShift allows you to view delete submissions and comments.

Usage

Example to fetch the latest 5 submissions from the r/pics subreddit:

import { getSubmission, SortMethod, SortType, SubmissionFields } from 'pushshift-api';

(async () => {
    const response = await getSubmission({
        subreddit: "pics",
        size: 5,
        fields: [
            SubmissionFields.Author,
            SubmissionFields.Title,
            SubmissionFields.Url
        ],
        sort_type: SortType.Created,
        sort: SortMethod.Descending
    });
    if (response) {
        for (let submission of response) {
            console.log(submission);
            /*
                {
                    author: 'An author',
                    title: 'A title',
                    url: 'URL to image'
                }
            */
        }
    }
})();

Keywords

FAQs

Last updated on 28 Oct 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc