import requests
import pandas as pd
url = 'https://www.reddit.com/r/dataengineering.json'
headers = {'User-Agent': 'Mozilla/5.0'}
response = requests.get(url, headers=headers)
data = response.json()['data']['children']
df = pd.json_normalize(data, record_path=['data'])
df = df[['author', 'title', 'created_utc', 'num_comments', 'score']]
print(df)
https://www.reddit.com/r/dataengineering.json?limit=100&after={{loop}}
foreach=0,100,200,300,400,500
cols="data0_created, data0_title, data0_selftext, data0_hide_score, data0_upvote_ratio, data0_ups, data0_total_awards_received, data0_link_flair_text, data0_author_premium, data0_link_flair_type, data0_author_flair_type, data0_id, data0_author, data0_num_comments, data0_permalink, data0_stickied, data0_url"
SELECT
max(toDateTime(data0_created)) as created,
data0_title as title,
max(data0_ups) as upvotes,
data0_author as author,
max(data0_num_comments) as comments
FROM
DS_.V_1001
GROUP BY data0_created,
title,
author,
data0_num_comments
ORDER BY upvotes DESC