wix-incubator / DeviantArt-API

The DeviantArt API
https://www.deviantart.com/developers/
MIT License
35 stars 5 forks source link

journal with 10041 comments (according to browse/user/journals) returns only 16 comments (according to comments/deviation) #177

Closed NotandorSS closed 4 years ago

NotandorSS commented 4 years ago

This get request:

https://www.deviantart.com/api/v1/oauth2/comments/deviation/01C4012D-55B0-9AF1-ECEC-763A072DAD87?limit=50

returns a total of 16 comments. However, paging through

https://www.deviantart.com/api/v1/oauth2/browse/user/journals?username=TokoTime&limit=50&featured=false

until I find the journal associated with that deviationid, the json response tells me there's 10041 comments

for result in responseJson['results']:
                if result['deviationid'] == '01C4012D-55B0-9AF1-ECEC-763A072DAD87':
                                print(result['stats']['comments'])

I know there are more than 16 comments posted to this journal - the journal links 11 comments, and only 1 of them is returned with the comments/deviation api. There doesn't appear to be any api available to fetch the comment ids for the missing comments. Looking through the documentation, the offset appears to have a max of 10,000 which I'm assuming is related to why this journal has broken and others haven't.

Even if this issue can't be fixed directly, a workaround to fetch comments on large journals would be greatly appreciated!

aaronpearce commented 4 years ago

Hi,

This API response is correct. comments/deviation returns the the first thread depth. This journal has thousands of comments, but all threaded. comments/deviation takes a commentid parameter, put one of the top level comment IDs into this to see the replies and so on. You can also set a maxdepth value to aid in threading.