Internal server error from YouTube Analytics API

2019-07-31 18:37发布

since yesterday we are receiving code 500 errors from the YouTube Analytics API. Nothing has changed in the relevant code since a few months ago, and everything always went smoothly before yesterday.

This is a sample query (but ALL queries to YT Analytics fail):

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D<channelid>&metrics=views,averageViewDuration,estimatedMinutesWatched,comments,likes,dislikes,shares,subscribersGained,subscribersLost&dimensions=channel&start-date=2016-06-01&end-date=2016-06-30&start-index=1

(with appropriate channelId and Authorization header set). This is what we are getting back:

{
    "code": 500,
    "message": "The remote server returned an error: (500) Internal Server Error.",
    "response": {
        "error": {
            "errors": [{
                    "domain": "global",
                    "reason": "internalError",
                    "message": "Unknown error occurred on the server."
                }
            ],
            "code": 500,
            "message": "Unknown error occurred on the server."
        }
    }
}

Any clues?

2条回答
我只想做你的唯一
2楼-- · 2019-07-31 19:20

It seems it mostly fixed this problem. I think the problem is on YouTube side. We are still waiting until they fix 100%.

查看更多
我想做一个坏孩纸
3楼-- · 2019-07-31 19:28

I got the same problem : "Error 500" for any youtube API called (yt-analytics.readonly).

Here is a workaround for fixing the problem :

  1. Add the following right on your application https://www.googleapis.com/auth/youtube.readonly, even if it's not usefull

  2. re-generate the refresh token

  3. everything is fixed

You can even remove the application and add it again wihtout the youtube.readonly right, it's still working. It's like the API got an update by adding this unusefull right.

I have also tested another workaround with the API Test Console, by adding "Google APIs Explorer" application with the youtube.readonly & yt-analytics.readonly unblock the problem and you dont have any "Error 500" with your own token.

Hope this helps and it's clear enought !

查看更多
登录 后发表回答