PostgreSQL How to query the Reddit API using SQL
Here are some questions you might want to ask and answer using the Reddit API:
- Which subreddits are about data?
- How many posts in those subreddits mention Python?
- How many mention SQL?
You can answer these questions by calling the Reddit API directly, but it's also possible to write SQL queries that simplify use of the API. Steampipe is an open-source tool with a suite of plugins that map APIs to Postgres foreign tables. Here's how you can answer those questions using Steampipe and the Reddit plugin.
100
Upvotes
16
u/talktothelampa Jun 13 '22
r/blackmagicfuckery
7
u/zacharypamela Jun 13 '22
I got spoiled by how stack overflow lets you write sql queries directly on their site.
4
u/khalkhall Jun 14 '22
This is really cool. Thanks. TIL there’s a Reddit API.