Invalid Developer Key

2019-04-12 04:30发布

I was reaching the youtube api quota limit while building my application so I added a developer key to the request and now I get a 403 error: Invalid Developer Key.

I've tried recreating my project and api key multiple times without any luck. I've tried adding the key to the URI as well as sending it in a header:

$c1 = curl_init($feedURL);
curl_setopt($c1, CURLOPT_HTTPHEADER, array(
   'X-GData-Key: key=AIzaS...',
   'GData-Version: 2'
));

My application is simple, all requested data is public, so I don't see a reason to use the Zend PHP Client.

标签: youtube-api
1条回答
来,给爷笑一个
2楼-- · 2019-04-12 05:02

You're using a v3 "API key" while querying v2 of the API.

v3 "API key"s are obtained from the Access tab of https://code.google.com/apis/console/ and are what you use to make non-authenticated requests to any of the APIs listed on that console.

v2 "developer key"s are obtained from http://code.google.com/apis/youtube/dashboard/ and is what you're looking for.

I believe that one of the goals is to retrofit v2 of the API to start supporting "API key"s from the API console, but that isn't something that's possible at this time.

查看更多
登录 后发表回答