Retrieving individual videos view count - Youtube API V3.0 - JavaScript

前端 未结 2 1207
孤独总比滥情好
孤独总比滥情好 2020-12-08 11:05

I\'ve been trying to get the view count on videos that I query through the following method:

      function search() {
        var request = gapi.client.yout         


        
2条回答
  •  情书的邮戳
    2020-12-08 11:51

    The link you gave https://developers.google.com/youtube/v3/docs/videos/list#try-it is working for me. To get duration and viewCount: Fill in for part: contentDetails,statistics and for id: a comma-separated-list of video-id's like: TruIq5IxuiU,-VoFbH8jTzE,RPNDXrAvAMg,gmQmYc9-zcg

    This will create a request as:

    GET https://www.googleapis.com/youtube/v3/videos?part=contentDetails,statistics&id=TruIq5IxuiU,-VoFbH8jTzE,RPNDXrAvAMg,gmQmYc9-zcg&key={YOUR_API_KEY}

提交回复
热议问题