You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

reddit-api-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-api-client

Reddit API


Maintainers
1

Readme

Installation

pip install reddit-api-client

Examples

Guest Endpoints
from reddit.scraper import Scraper

reddit = Scraper()

homepage = reddit.homepage()

popular = reddit.popular()

front_page = reddit.front_page()

subreddit = reddit.subreddit("pics")

search = reddit.search(
    'api blackout',
    includePosts=True,
    includeCommunities=True,
    includeAuthors=True,
    includeComments=True,
    # communitySearch=False,
    # customFeedSearch=False,
    # postsAfter=None,
    # communitiesAfter=None,
    # authorsAfter=None,
    # commentsAfter=None,
    filters={
        'nsfw': '0',  # {'1', '0'},
        'time_range': 'null',  # {'hour', 'day', 'week', 'month', 'year', 'null'},
        'post_types': 'null',  # {'gif', 'image', 'link', 'poll', 'text', 'video', 'null'},
        'result_types': '',  # {'subreddit', 'profile', ''}
    },
    sort='NEW',  # {'RELEVANCE', 'HOT', 'TOP', 'NEW', 'COMMENTS'}
)
Auth Endpoints
from reddit.scraper import Scraper

username, password = ..., ...
reddit = Scraper(username, password)

# get data from posts
posts = reddit.posts({
    'pics': ['147p5ql', '146zsax'],
    'funny': '143wysp',
})

# comment on a post
reddit.comment('146zsax', 'test 123')

Keywords

FAQs


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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc