The Pros and Cons of Youtube’s API

Masonwaller
3 min readJan 3, 2020

The youtube API is a very easy to use and great way to implement videos into your application. It makes it really easy to just use their provided code without connecting your app to their API. Most APIs you will have to provide a link to their server and you will have to pull from that the specific information you need. Youtube provides a simpler and easier way to add this information to your app.

To get a specific video onto your app all you need to do is go to that video and hit the share button underneath the video.

After that hit the embed button and you have all the code to put that video in your app. No linking required.

Once you have copied all the code from hitting the embed button you can add that anywhere in your html file. It is written in html and won’t work in any other language (You can add it though through editing html with other languages, like JS).

There is very little that you can alter with this video due to Youtube’s latest API changes. These are the cons. You cannot hide the title of the video and the recommended videos once the video is over. There is no way around this because Youtube is trying to protect its content creator’s. This is good and bad, bad for developers because sometimes you do not want the title showing and don’t want any recommended videos showing.

There are some things that you can manipulate though. To manipulate the video all you have to do is add small snippets of code to the link. Like so…

These are examples of some edits you can add to the video. I am sure there are more but these are the ones I am familiar with. The number 1 in all these code snippets as you can probably guess is a boolean value. So to turn these edits off all you have to do is turn that 1 into a 0. Controls above gives the user of your app the youtube controls like sound volume, full-screen, and pause button. The autoplay snippet causes the video to start as soon as it loads. The loop snippet is suppose to cause the video to continue to loop and never truly end but I have had some issues with it where it doesn’t work.

As you can see Youtube’s API is awesome but provides some problems to developers. It is easy to use and easy to manipulate but you have very little agency with how it displays to your app.

--

--