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

拟墨画扇 提交于 2019-11-29 12:35:51

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.

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/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!