How to get all comments on a YouTube video?

前端 未结 5 604
眼角桃花
眼角桃花 2020-12-12 16:36

Since Google has deprecated the YouTube v2 API, I cannot find a way to get all the comments from a video.

Is it possible to use a single, non-deprecated API (Google+

5条回答
  •  眼角桃花
    2020-12-12 17:14

    $.ajax({
            dataType: "jsonp",
            type: 'GET',
    url: "https://www.googleapis.com/youtube/v3/commentThreads?key=PUT-YOUR-KEYXXXXXXX&textFormat=plainText&part=snippet&videoId=PUT-YOUR-VIDEO-ID",
            success: function(result){
                data = result;
                $('.data').text(data);
                console.log(data);
        }});
    

    To find PUT-YOUR-KEY(API key) ---> https://console.developers.google.com/apis/credentials then click on blue color button select API key option you can get

提交回复
热议问题