From the course: Introduction to Web APIs

APIs in plain English - REST Tutorial

From the course: Introduction to Web APIs

APIs in plain English

- API stands for Application Programming Interface. While it may not be completely clear what that means at first, it's actually a fairly straightforward concept. One way that may help to understand APIs is to think of them like a restaurant. Let's say, you're really in the mood for a pastry. You could make it from scratch, but you'd have to go to the store, buy all the ingredients, and bake it yourself. It can be expensive, it can take a lot of time and you may not have the expertise to bake it properly. Or you could go to a restaurant, At a good restaurant, the food is excellent and all the work has already been done for you. You order from a menu that list all the available dishes and organizes them into different categories like appetizers, salads, entrees, and desserts. The menu typically list information about the dishes including ingredients and price. Once you decide, you simply tell the server what you like. I'll get the muffin, please. - All right. - They take your order to the kitchen and the food is brought to you ready to eat. - Here you go. - Thank you so much. - You're welcome. - It's great. You get the food you want and you didn't have to make it yourself. You don't even have to know how they made it. You just had to know how to order it and now you get to enjoy delicious food without having to do any of the work. While this isn't a perfect analogy, it is a helpful way to think about how APIs work. With an API, you also want to get something. Although it's not food, it's data. There are all kinds of companies out there that provide data through the use of their APIs. Data on sports, weather, finance, outer space, gifs, you name it. Like a menu in a restaurant, companies provide documentation that explains what data's available and how to ask for and get that data. Then like a server at restaurant, you request that data from the API, it goes and gets it, and brings it back for you to use as you like. Again, like your food at a restaurant, you don't have to create the data yourself, you don't have to create a tool to access it, and you don't have to understand how it's made. You just order it and then you get to enjoy it.

Contents