Skip to main content

Reddit API

Project description

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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reddit-api-client-0.0.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

reddit_api_client-0.0.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file reddit-api-client-0.0.0.tar.gz.

File metadata

  • Download URL: reddit-api-client-0.0.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for reddit-api-client-0.0.0.tar.gz
Algorithm Hash digest
SHA256 b027ac0b0b6369b704aeeb1f470d4db0cc68eb291f01dc6d853d9f2fc38bbcae
MD5 243e59e3ffa96f5f91ad9744203c72c3
BLAKE2b-256 4f473b27586ee73739b7a27247f54772cc759427dc5fac1481083ff0cda97068

See more details on using hashes here.

File details

Details for the file reddit_api_client-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reddit_api_client-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87cb4a4d7685d33b0b2638084d34698856db760ef61398bb8398c80c00f3fa29
MD5 d3860ee5e146d1e4134b19580c632638
BLAKE2b-256 94c1f665b33e068667d9d673553fe6d9b4897c9e16d0f4ac2549607760019cee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page