Intro to Programming and Data Science (Fall 2023)/Reddit authentication setup

From CommunityData
< Intro to Programming and Data Science (Fall 2023)
Revision as of 22:24, 25 August 2023 by Jdfoote (talk | contribs) (Created page with "We're going to be using Reddit as a context for learning to gather web data. Like many APIs, in order to use the Reddit API, you need a developer account. This is pretty easy on Reddit. # Create a reddit account at https://www.reddit.com/ # Go to https://www.reddit.com/prefs/apps and click "Create an app" # Enter the following (or similar): #* Name: COM 674 Project App #* Description: This bot will be used to collect data as part of a course at Purdue University. #* A...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

We're going to be using Reddit as a context for learning to gather web data.

Like many APIs, in order to use the Reddit API, you need a developer account. This is pretty easy on Reddit.

  1. Create a reddit account at https://www.reddit.com/
  2. Go to https://www.reddit.com/prefs/apps and click "Create an app"
  3. Enter the following (or similar):
    • Name: COM 674 Project App
    • Description: This bot will be used to collect data as part of a course at Purdue University.
    • About URL: LEAVE BLANK
    • Redirect URL: http://localhost:8080 (We won't actually be using this)
    • For the application type, select "Script" and submit.
  4. Create a new .py file called reddit_authentication.py that looks something like:
   client_id = "_anb-xipuqf7jA9wzeMqZ"
   client_secret = "4kXxiBOFdPY1HBw4gm6oiTYbWkFgz"
  • The client_id is found at the top left of the apps page, under your app's name. The client secret is right under that.

We'll use this authentication file in the future.