1

I need to get the view count of a Youtube playlist, so I used this API call https://developers.google.com/youtube/analytics/v1/channel_reports#playlist-reports

I don't know what's the value to pass in filters. I tried isCurated==1;playlist==LLR14ObbzEt-fw00wGkxQznA, but it returned me this :

GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCR14ObbzEt-fw00wGkxQznA&start-date=2006-12-01&end-date=2015-10-22&metrics=views&filters=isCurated%3D%3D1%3Bplaylist%3D%3DPL7aghK2Vb4MGM1cC2mNLCwwai_uQ7vuyD

200 OK

- Show headers -

{
 "kind": "youtubeAnalytics#resultTable",
 "columnHeaders": [
  {
   "name": "views",
   "columnType": "METRIC",
   "dataType": "INTEGER"
  }
 ]
}

What is wrong?

Le Duy Khanh
  • 1,339
  • 3
  • 17
  • 36

2 Answers2

0

Perhaps your playlist did not receive any views during that time frame. Keep in mind YouTube analytics only has data starting from 2/1/2014, so it could be that your playlist did not have any views during your specified time frame. I've made similar calls, and it seems that if your playlist has no data for the specified metrics YouTube will simply return an empty row instead of returning 0's.

bluej
  • 1
-1
youtube_analytics = build('youtubeAnalytics','v1', http=http)

end_date=datetime.datetime.now().strftime("%Y-%m-%d")

analytics_query_response = youtube_analytics.reports().query(ids="channel==%s"%channel_id,metrics='views,estimatedMinutesWatched,averageViewDuration,playlistStarts,viewsPerPlaylistStart,averageTimeInPlaylist',start_date='2004-01-01',end_date=end_date,filters="isCurated==1").execute()
Sampath
  • 63,341
  • 64
  • 307
  • 441