Reddit API tutorial Python - Reddit PRAW

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 23. 07. 2024
  • Reddit API tutorial in Python with the PRAW library (makes it easy to scrape Reddit) - a step by step tutorial on how to use the Reddit API. You'll understand what the PRAW library is all about, and be able to pick up in the docs where we leave off.
    đŸ’„ Subscribe here → / @runthat
    Please give this video a thumbs-up! 👍
    ┉┉┉ Share this video 🔗
    Video link → ‱ Reddit API tutorial Py...
    Blog post → www.runthat.blog/reddit-comme...
    ┉┉┉ You might like these, too đŸ“č
    Python QuickStart Guide 😎
    Learn Python with my affiliate link → amzn.to/42La1oQ
    Python Crash Course 📗
    Best selling Python book, my affiliate link → amzn.to/3q3LflH
    Reddit bot PRAW - Python project
    Video link → ‱ Reddit API bot PRAW - ...
    Blog post → www.runthat.blog/reddit-comme...
    ┉┉┉ Follow me âšĄïž
    CZcams → / @runthat
    Reddit → / m_runthat
    Twitter → / m_runthat
    Instagram → / m_runthat
    Blog → www.runthat.blog
    ┉┉┉ Chapters in this video 📓
    00:00 Introduction
    00:22 Get Reddit API key
    01:07 Import PRAW
    01:34 Create PRAW Reddit instance
    02:25 Authenticating with Reddit API
    03:05 Get posts from a Subreddit
    04:10 Print the posts
    05:56 💾 #runthat #1
    06:24 Get comments for a post
    07:50 💾 #runthat #2
    ┉┉┉ Video notes 📝
    What is the Python PRAW library?
    PRAW stands for "Python Reddit API Wrapper." It's a Python library that provides a simple interface for accessing and interacting with the Reddit API. PRAW is designed to make it easy to create Reddit bots, automate tasks, and analyze data on the platform. PRAW allows you to authenticate with Reddit, access subreddit and user data, and perform actions like upvoting, downvoting, commenting, messaging, and more. The library handles the details of making HTTP requests and parsing JSON responses, so you can focus on building the functionality of your bot.
    PRAW is an open-source library and is actively maintained by a community of developers. It's compatible with Python 3.x and can be installed using pip. PRAW also has extensive documentation and a number of helpful examples to get you started. Overall, PRAW is a powerful and versatile library for working with the Reddit API in Python and is a popular choice for building Reddit bots and applications.
    If you are interested in using the Reddit API, generally, you can check out my blog post and CZcams video on how to use the Reddit API without PRAW. See the links in RELATED CONTENT above. In that post and video, we use the Reddit API without PRAW.
    What are Reddit bots?
    Reddit bots are becoming increasingly popular as more and more people seek to automate their interactions with the platform. Whether you want to monitor conversations, promote your content, or simply engage with other users on the platform, creating a Reddit bot can be a powerful tool. In this video, we'll walk through the steps of building a Python Reddit bot that can respond to comments in a subreddit. With just a few lines of code and the Python Reddit API Wrapper (PRAW), we can create a bot that monitors specific subreddits, detects certain keywords or phrases, and responds to comments with a customized message.
    Reddit bots are programs that can perform automated tasks on the Reddit platform. These bots can be created by anyone with programming skills and can be designed to perform a wide range of functions, such as monitoring subreddits, responding to comments, posting content, and analyzing data. Reddit bots can be built using a variety of programming languages, including Python, JavaScript, Ruby, and others. They can interact with the Reddit API to access data and perform actions, such as upvoting, downvoting, commenting, and messaging other users.
    Some Reddit bots are designed to perform helpful tasks, such as providing users with useful information, tracking trends, or moderating content. Other bots, however, can be used for more nefarious purposes, such as spamming or manipulating votes. It's important to note that not all bots on Reddit are created equal, and some may violate Reddit's rules and guidelines. It's always a good idea to check the rules and guidelines before creating a bot and to test it thoroughly before releasing it into the wild.
    How to create a Reddit bot with Python and PRAW
    Before we get into the code, you will need to create a Reddit app. You need to be a Reddit user with a username and login. Go to / apps and log in to your Reddit account when you're prompted. Then, scroll to the bottom of the page and click the button to create an app. You will need to enter the app name (use whatever you like but note that you can't use the word Reddit in your app name)
    ... WATCH THE VIDEO FOR MORE!

Komentáƙe • 28

  • @user-oy4uc8of4l
    @user-oy4uc8of4l Pƙed 15 dny +1

    Thank you very much for this tutorial it helped me a lot. Thank you.

  • @DigitalMirrorComputing
    @DigitalMirrorComputing Pƙed 3 měsĂ­ci +4

    that was an AWESOME tutorial! Helped me build my scrapper in 10 mins! Perfect! Subbed! :)

    • @runthat
      @runthat  Pƙed 3 měsĂ­ci +1

      Aw thank you so much!!!

  • @t.doughty7389
    @t.doughty7389 Pƙed 7 měsĂ­ci +3

    thanks so much for this! so easy to follow and not a bunch of useless detail

    • @runthat
      @runthat  Pƙed 7 měsĂ­ci +1

      Thank you for watching!!!

  • @matteomorellini5974
    @matteomorellini5974 Pƙed měsĂ­cem +1

    Super useful thanks

  • @dariyanagashi8958
    @dariyanagashi8958 Pƙed rokem +5

    Thank you for this tutorial, it was very helpful!

    • @runthat
      @runthat  Pƙed rokem +1

      Thanks and my pleasure!

  • @aaron10k
    @aaron10k Pƙed 5 měsĂ­ci +1

    this was incredibly good and straightforward. thanks

    • @runthat
      @runthat  Pƙed 3 měsĂ­ci

      Thank you!!

  • @omadden234
    @omadden234 Pƙed 5 měsĂ­ci +1

    Great video, well explained. Thank you!

  • @EdwinJoel.J
    @EdwinJoel.J Pƙed 3 měsĂ­ci +1

    Really a good tutorial ! Amazing !

    • @runthat
      @runthat  Pƙed 3 měsĂ­ci

      Glad it was helptul!

  • @Esprasso
    @Esprasso Pƙed 6 měsĂ­ci +2

    Thanks for this video❀

  • @user-ys4yo2zt3t
    @user-ys4yo2zt3t Pƙed 10 měsĂ­ci +1

    thanks dear, it was very useful.

    • @runthat
      @runthat  Pƙed 10 měsĂ­ci

      You're welcome!

  • @user-br3ye1yq2q
    @user-br3ye1yq2q Pƙed 9 měsĂ­ci +3

    This video is very helpful but... why I receive a "400 HTTP response"? I modified yet info about my app. 😔

    • @runthat
      @runthat  Pƙed 9 měsĂ­ci +1

      Must be a typo somewhere or something up with the Reddit API!

  • @TrueJellyFisherMan
    @TrueJellyFisherMan Pƙed 6 měsĂ­ci +1

    How to get urls of videos And download it?

  • @danirojas4040
    @danirojas4040 Pƙed měsĂ­cem +1

    Hello, is there a way to get comments from multiple posts at the same time?

    • @runthat
      @runthat  Pƙed měsĂ­cem +1

      Hi yeah you should be able to get Copilot or ChatGPT to tweak the python to do that without any trouble. East change just adjust the API call, it's just a lil code.

  • @tibbsyt5625
    @tibbsyt5625 Pƙed 11 měsĂ­ci +1

    Currently trying to learn Python what’s the best route to go down? I’m thinking ML but I suck at Math lol

    • @runthat
      @runthat  Pƙed 11 měsĂ­ci +3

      Automate weird things. Anything you’d do with a mouse.

  • @sanskritiverma5599
    @sanskritiverma5599 Pƙed 5 měsĂ­ci +1

    is it possible to scrape all the posts from last two years?