API stands for Application programming interface. We will try to understand the API in the simplest possible way.
Suppose, you just returned from your workplace and are very hungry. You immediately rush into a restaurant and the waiter comes with a menu in his hand.
You choose items from the menu provided by the waiter and ordered your items for launch. Now, consider an API is the waiter of that restaurant.
Restaurants’ kitchen is the place where your orders will be prepared and you don’t have access to that kitchen. Here, the waiter is the bridge between you and the kitchen. You ordered food and the system (kitchen) prepared it for you. API does the same thing as the waiter is doing here. Lets, look at the images below.
Let’s take another example,
Person X: Hello, API I want this much amount of data from person Y.
API: Yeah, sure sir.
(Communicates with Person Y and asks for the requested data. Y gives data. API generates a structured format of the response. An API goes to Person X)
API to Person X: Hey Sir, here is your required data.
So, basically an API is the interface where two different systems communicate with each other. API facilitates their interaction process.
Here you can assume Person X and Person Y both as different systems, who want to access and send data to each other.
Why API is so useful?
Suppose, you want to make a new app like UBER or LYFT where users can request for a ride. You will need to build your own map for creating the application. The process of building a new map is really costly and it requires a lot of data. But, Google has already developed its map API to reduce your pain. You can use their map API in your application as your need and pay them. This way API helps you to make your life easy and simple.
Some popular API Examples
- Google Maps API
- Facebook API
- YouTube API
- Twitter API
- Amazon Product Advertising API