2

I'm trying to build an youtube based app, and I'm using version 3.0 of Youtube Data API, I did register the app in Google Cloud Console and I did obtain an API Key. After that I tried to test it in a console application in Visual Studio 2010, I used a WebClient to retrieve a video search using this URL "https://www.googleapis.com/youtube/v3/search?part=snippet&q=YouTube+Data+API&type=video&key={MY API KEY}"

I learned this from here. I used both a Browser key and a Server key, but the server sends back an error saying the request is incorrect.

So can anyone point me to the error I'm making?

PS: I am trying to make a windows phone app, and before doing so I wanted to learn how to manipulate the Youtube API first, this is why I am testing in a console application

Ayoub.A
  • 1,943
  • 3
  • 27
  • 34
  • You're supposed to use a server key. Did you enable the API? This video shows you how to do it for the old version, but the concept still applies (http://www.youtube.com/watch?v=Im69kzhpR3I&list=PLhBgTdAWkxeB-zCekGukAo0DzmpwBiua2&index=1) – Ikai Lan Jan 13 '14 at 20:28
  • Yes I did before posting the question – Ayoub.A Jan 14 '14 at 09:52

1 Answers1

4

Make sure that the YouTube Data API is enabled in the Google Developer Console. It should look something like this:

enter image description here

The key you are looking for is the server key, which looks something like this:

enter image description here

(I've truncated my key for security purposes). I now copy and paste this into my browser window:

https://www.googleapis.com/youtube/v3/search?part=snippet&q=YouTube+Data+API&type=video&key=YOURKEYWOULDGOHERE

This works for me. Start here to verify that the key is working and that the API has been enabled correctly. I suggest using the API client, because some API calls will require an OAuth 2.0 access token, not the simple API key (search API requires regular simple API key).

Ikai Lan
  • 2,210
  • 12
  • 13
  • Thanks for your post. I have no idea why they named it a server key instead of a client key. Created quite a bit of confusion for me since I'm running a desktop client app. – Robert Oschler Mar 28 '16 at 04:04