2012-11-21 36 views
7

如何在YouTube API版本3中爲視頻獲取評論?我一直在嘗試youtube.activities.listyoutube.videos.list以及Google API Explorer中的大多數其他方法。我在這裏錯過了什麼嗎?如何在YouTube API版本3中獲取評論?

youtube.activities.list似乎是正確的電話,但只能返回自己的上傳和播放列表的項目。)

回答

7

更新:評論功能現在在數據API V3提供。 http://youtube-eng.blogspot.com/2015/04/manage-comments-with-youtube-data-api-v3.html

Data API的v3中不支持視頻註釋。如果您需要檢索或添加註釋,則需要使用Data API的v2。

+4

有沒有ETA通過第3版API獲取意見的時候會推出? –

+0

沒有,沒有。 –

+0

Hi @Jeff,在任何視頻流的apis中是否有任何評論端點?一種獲取和發佈對直播流評論的評論的方法? – KRB

1
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&maxResults=20&videoId=Au87oAJ2jeE&key=app-key 

結果JSON

{ 
"kind": "youtube#commentThreadListResponse", 
"etag": "\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/Q8IErPBy5AB6a2BKgaDaOWcf_jQ\"", 
"pageInfo": { 
    "totalResults": 10, 
    "resultsPerPage": 20 
}, 
"items": [ 
    { 
    "kind": "youtube#commentThread", 
    "etag": "\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/bdn5c_ALv5vbJlPCzNuP1B9UqiU\"", 
    "id": "z12qxfxr2onpy1b5l04cdfzrgwabir0q4bo", 
    "snippet": { 
    "channelId": "UCJr72fY4cTaNZv7WPbvjaSw", 
    "videoId": "Au87oAJ2jeE", 
    "topLevelComment": { 
    "kind": "youtube#comment", 
    "etag": "\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/JZObCX09D4_6WRoUvqcZuSWtjRw\"", 
    "id": "z12qxfxr2onpy1b5l04cdfzrgwabir0q4bo", 
    "snippet": { 
     "channelId": "UCJr72fY4cTaNZv7WPbvjaSw", 
     "videoId": "Au87oAJ2jeE", 
     "textDisplay": "Thank you Dan and Envato for creating this video!\ufeff", 
     "authorDisplayName": "Randy Taschner", 
     "authorProfileImageUrl": "https://lh6.googleusercontent.com/--vE0X3_vDCs/AAAAAAAAAAI/AAAAAAAAAJU/aBCbmKPAMtc/photo.jpg?sz=50", 
     "authorChannelUrl": "http://www.youtube.com/channel/UCTRuBHRb4BRFcob-hMj6NnQ", 
     "authorChannelId": { 
     "value": "UCTRuBHRb4BRFcob-hMj6NnQ" 
     }, 
     "authorGoogleplusProfileUrl": "https://plus.google.com/109363234563168058777", 
     "canRate": false, 
     "viewerRating": "none", 
     "likeCount": 1, 
     "publishedAt": "2015-08-16T05:02:25.807Z", 
     "updatedAt": "2015-08-16T05:02:25.807Z" 
    } 
    }, 
    "canReply": false, 
    "totalReplyCount": 0, 
    "isPublic": true 
    } 
    } 
}