What is an API?

A free video tutorial from Nate Ross
Technology Teacher
Rating: 4.6 out of 5Instructor rating
1 course
73,134 students
What is an API?

Learn more from the full course

API and Web Service Introduction

Includes API, Web Services using REST, JSON, XML, HTTP, SOAP, OAuth, OpenID Connect, Postman and Python

06:46:42 of on-demand video • Updated May 2022

Introduction to APIs and RESTful Web Services. Includes HTTP, JSON, XML, REST, SOAP, OAuth, OpenID Connect, Postman, and Python. Includes examples and a quiz.
What is an API? Let's go over the definition of what an API is. So API is an acronym. An acronym means a bunch of letters and those three letters in API are A, P, and I. Each one of these letters stands for a word, and the A stands for Application, the P stands for Programming, and the I stands for Interface. Now what to each one of these words mean? Application means a piece of software that does a task. For example, EBay has software that sells you items; Pandora plays music; WAZE provides you with directions; Skype provides you with conversations; Google provides you with search results. These are examples of pieces of software that do tasks for you. And how do they do these tasks? They do these tasks through programs. So programming is the program that does the task within the application. So for example Pandora application uses a program to play music for you. Right? It just doesn't do it by itself, you have to run a program, the play music program, to play the music for you. And lastly is interface. Now what is interface? Interface is a place where you could tell that program to run within that application. So what are examples of interfaces? Well, on your cell phone you have apps and each one of these apps is actually an interface. Think about it. For example I have the WAZE app that provides me with directions. So by using this WAZE interface when I click on this app, I use this interface that tells a program to run in the WAZE piece of software and that program will give me back directions. And other examples are Google Translate. So I have it here, this is my interface, the Google Translate app, and I put in a word and say I want it translated in Spanish. Well, that word then gets sent to a program in a Google server somewhere and that program sends me back the translation. So each one of these is actually an API interface. Interface is a place where you tell the program to run. And here's a place where we could tell the program to run for us. So, this is an example on my cell phone. But there are other examples of APIs not just on your cell phone but everywhere. For example if you have a computer if you want to do a Google search you have the interface that is the search page the Google search page. And from this interface the Google search page you tell Google, that is the Google application, to run a program which does the search for you and provides you back the web page with results. API you can look at it not as just API but IPA. Look at it the other way around. If you look at it the other way around and start with the interface. You start with the interface and at the interface (I) is where you tell a program (P) to run in an application (A). Right? So that's what an API is. What are the advantages of APIs? What makes them so great? Because they are great. Well, first you don't have to write the program you just use it. Alright? So, for example I have my Pandora app to play music here. Here is my interface right here to tell Pandora to play music for me and I don't have to write the program to play music. I don't have to pay the artist fees. I don't have to do any of this. All I have to do is just say hey, run the program to play music. Let's look at another reason that makes APIs great. It's platform independent. In other words you can run this interface from anywhere. I could download this Viber app on my cell phone. I could also download the same Viber interface on a Windows computer or an Apple computer. So whatever platform you're on, whether it's a cell phone or it's a computer or whatever it is that you have, you can still run this program. You just tell the program to run. So it doesn't depend on where it's coming from. You just tell it to run. And the third thing that makes APIs great is that it's upgrade safe. You don't have to worry about the upgrades because technology is going so fast. This cell phone is going to be, say, it's new today, in two years it's going to be old. Right? That's how fast it's going. They need to upgrade the program. You don't have to worry about that. Now one more thing I would like to go over is that when people talk about APIs they're generally not talking about simple APIs. Now these are all APIs. Application programming interfaces. These are places where you tell a program to run in a piece of software. However, when people talk about APIs, they're generally talking about going to the interface where the server is located that runs the program. For example this Google Translate app it's real easy to use because the interface here is located on my cell phone. But when people talk about APIs they're generally talking about this interface not located on my cell phone, but I would have to, if it's the Google Translate, go to the Google server and call the interface at the Google server. And the reason why they say APIs have to be located at the server level is because in the technology world unfortunately we have a lot of geeks and we want to try to make it complicated but it's not really complicated. APIs are great and I'm excited that you're learning about them.