Youtube API - 从视频中获取热门评论 [英] Youtube API - Get top comments from a video

查看:24
本文介绍了Youtube API - 从视频中获取热门评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从视频中获得热门评论?也许按点赞数排序?

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

这是我当前的网址:

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

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

提前致谢!
彼得

Thanks in advance!
Peter

推荐答案

是的,我发现按相关性排序是一种很好的方法,例如在 JS 中:

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`);

这篇关于Youtube API - 从视频中获取热门评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆