r/redditdev•
SJS830

Get all comments on thread through json api?

Reddit API

I am looking to get the top 100 comments of a thread through the json api. Right now the url I have is https://www.reddit.com/r/AskReddit/comments/<submission>.json. This returns around 50 comments with the last element being "more." How can I use this to get the top 100 comments?

Posted Mar 6, 2020, 3:06 AM UTC

53
SirensToGoThird party anarchist iOS dev•

Use the ?limit=1000 to get the first 1000 (if you have gold). Reddit will, however, always hid parts of the tree if they're too deep or if there are too many. To fetch more, you'll need to interact with the more API. This is really a pain in the ass since you are limited to a single call at a time (aka concurrency=1) and so if you need to fetch all of them it's a slow process

2
SJS830OPBot Developer•

Hey, can you explain how to do that? The more comments don’t seem to be sorted

1
SJS830OPBot Developer•

Actually never mind, I found /api/morechildren, I’ll try to figure it out myself

1