How to use API KEY with YouTube in angularjs and list videos in a playlist?

I want to list a bunch of videos from YouTube in my mobile app using angularjs. Preferrably I’d like to list all videos of a user/channels specific playlist.

I’ve gotten the API KEY from Google Developer Console but I don’t understand how and where to use it. In this documentation they only go over the oauth method. https://developers.google.com/youtube/v3/code_samples/javascript#authorizing_requests I tried using the example code straight up from that documentation only to get a message saying I have to authenticate first.

I’d really appreciate some help into this. How do authenticate using the api key and secondly how to make the request to get the videos in a playlist. Thanks!

Examples are a great way to learn.

1 Like

Hi @mhartington do I use the browser key or Android key?

I believe you would use the browser key, since it’s technically a webview

Ok thanks, should the domain be ‘localhost’?

For demo and testing purposed yes, you can use localhost

1 Like

Thanks very much you have helped a lot. How about when the app has been deployed in release mode? What domain will I use?

Thanks again Mike!

You would probably want to have a registered domain for that.