🖥️ Week 02, Day 03 - Lecture
API Authentication Patterns
By the end of this session, you should be able to: i) Understand common API authentication methods (API keys, Basic Auth, Bearer tokens, OAuth 2.0). ii) Use API params
to control and filter data requests. iii) Implement secure credential management using .env
files. iv) Apply authentication patterns to collect data from the Reddit API. v) Handle nested JSON responses and convert them to pandas DataFrames. vi) Recognise when different authentication methods are appropriate for different APIs.
Welcome! Today we’re moving from public APIs to authenticated ones—a key skill for accessing richer data sources.
We’ll use a hands-on approach: learn security principles, set up Reddit credentials together, then understand the authentication patterns you just used.
⏰ Date and Time: Wednesday, 23 July 2025 | 10.00am - 1.00pm 📍 Location: CKK.2.06 (see LSE’s 🗺️ campus map)
🗣️ Today’s Plan
📚 Part 1: Security & API Foundations (50 minutes) REST APIs, HTTP headers, security principles, and why credentials matter.
🛠️ Part 2: Reddit Setup Together (45 minutes)
Follow along: create Reddit credentials, test authentication, secure your.env
file.🎓 Part 3: Understanding What We Just Did (25 minutes) API Keys vs Basic Auth vs Bearer Tokens vs OAuth 2.0—and why Reddit uses Bearer tokens.
🎬 Lecture Slides
Use your keyboard arrows to move through the slides below. You can also view them in fullscreen.
Prefer a PDF? Download the slides here: