Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
polygot
· 7y ago · 0 comments
If you add .json to the end of a Reddit URL, it will return JSON data. For example:
https://www.reddit.com/r/ubuntu.json
. It also works with comment threads and posts.
Comments
[–]
avip
7y ago
Wonderful feature also used by Trello
https://trello.com/b/rq2mYJNn/public-trello-boards.json
[–]
ludamad
7y ago
Now that is an ergonomic API.
[–]
polygot
OP
7y ago
Also, it outputs XML and RSS too:
https://www.reddit.com/r/ubuntu.rss
and
https://www.reddit.com/r/ubuntu.xml
[–]
ahbyb
7y ago
xml and rss seem to be the same exact output
[–]
sneak
7y ago
I have adopted this in other projects and added the functionality there as well; it is a brilliant idea.
[–]
diminoten
7y ago
Yeah no need to scrape Reddit, their content is accessible via their API.
[–]
Raidion
7y ago
PRAW is also a great python reddit "scraper" that allows you to pull data via their API very easily.