Youtube Analytics API PHP Invalid query. Query did not conform to the expectations

后端 未结 2 798
-上瘾入骨i
-上瘾入骨i 2020-12-20 08:22

I\'m trying to make some analytics query from server to server. I\'m using laravel with https://github.com/google/google-api-php-client library.

This is the code I

相关标签:
2条回答
  • 2020-12-20 08:54

    You need to add a Google API key

    https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2014-05-01&end-date=2014-06-30&metrics=views%2CestimatedMinutesWatched&dimensions=day&sort=day%2Cviews&key={YOUR_API_KEY}
    

    also if you look at your string you have type error on the end where "-views" should be just "views" without dash You can use Google automated tool to generate a valid link.

    https://developers.google.com/youtube/analytics/v1/

    0 讨论(0)
  • 2020-12-20 09:04

    I tested your query and it's working fine, but apparently YouTube does not support service accounts. The documentation says it should return a 403 in this case, but for some reason it's returning 400.

    0 讨论(0)
提交回复
热议问题