1

I am trying to get the same report that I see through their UI by using their API.

When I specify the following metrics and dimensions the query does not work:

  • Metrics - views, viewerPercentage, estimatedMinutesWatched, averageViewDuration, averageViewPercentage
  • Dimensions - insightTrafficSourceType

However, if I trim down the metrics to just: views, estimatedMinutesWatched the query works fine.

Here's the response I get in case of error from YouTube API:

HTTP/1.1 400 Bad Request
Vary: Origin
Vary: X-Origin
Content-Type: application/json; charset=UTF-8
Date: Wed, 06 Jan 2016 09:01:17 GMT
Expires: Wed, 06 Jan 2016 09:01:17 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Content-Length: 461

{
 "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."
 }
}
d0kt0r1
  • 305
  • 1
  • 3
  • 15

1 Answers1

0

I've seen this error before when an invalid filter or dimension was used. I was able to duplicate this issue with the Google API Explorer and the issue went away when I removed the 'viewerPercentage' metric. This is strange since it is shown in YouTube documentation as a supported core metric: https://developers.google.com/youtube/analytics/v1/dimsmets/mets#viewerPercentage. I wasn't able to find anything in regards to it being deprecated, so I'm unsure as to the cause beyond it appearing to be a problem with the Youtube Analytics API.