0

What i am trying is, to get top 10 videos of my Youtube channel based on likes using analytics api v1.

To get based on views

GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2005-05-01&end-date=2014-06-30&metrics=estimatedMinutesWatched%2Cviews%2Clikes%2Cshares&dimensions=video&max-results=10&sort=-views&key={YOUR_API_KEY}

this end point is used where sort=-views is the sorting factor.

I am doing the same way to sort based on likes sort=-likes

But I am getting error response

400 Bad Request


- Show headers -


{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
   }
  ],
  "code": 400,
  "message": "The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
 }
}

By hit and trial i came to know the sort=-views and sort=-estimatedMinutesWatched are working but others i.e. likes,comments etc are not working. What is the possible reason? Any other way to do this?

Dev
  • 378
  • 2
  • 16

1 Answers1

0

Check your sort parameter based on the supported parameters from documentation.

So far, these are the supported filters:

  • views
  • redViews
  • estimatedRevenue
  • estimatedRedPartnerRevenue
  • estimatedMinutesWatched
  • estimatedRedMinutesWatched
  • subscribersGained
  • subscribersLost

Also if this could help, I think you can try Videos: getRating.

Retrieves the ratings that the authorized user gave to a list of specified videos.

But this method is basing on the ratings not the actual likes, but one of the following:

  • dislike
  • like
  • none
  • unspecified

See this SO post for further reference.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65
  • i guess Estimated revenue and ad performance metrics are not currently supported for channel reports. – Dev Apr 24 '18 at 06:36