Peter
Peter

Reputation: 11835

Youtube API - Get top comments from a video

Is it possible to get the top comments from a video? Maybe sorted by number of thumbs up?

This is my current url:

http://gdata.youtube.com/feeds/api/videos/'+yt_id+'/comments?alt=json-in-script&callback=?&max-results=50

Thanks in advance!
Peter

Upvotes: 2

Views: 2281

Answers (2)

r g
r g

Reputation: 23

Yes I found that sorting by relevance is a good way of doing this for example in JS:

const comments = await axios.get(`https://www.googleapis.com/youtube/v3/commentThreads?key=${YOUR_API_KEY}&textFormat=plainText&**order=relevance**&part=snippet&videoId=${YOUR_VID_ID}&maxResults=100`);

Upvotes: 2

dorvak
dorvak

Reputation: 9709

Unfortunately, i think there is no such option. You can´t (or i didn´t manage to get it working) order by rating, likes etc. of comment, because there is no gdata-tag like "rating" etc. for comments. YouTube doesn´t provide this so far. You can vote for it here

Upvotes: 2

Related Questions