API stands for Application Programming Interface. API is an intermediary for software to talk to each other. In Other words, an API is similar to the messenger which texts requests, and tells the system what you want to do, and returns a response back to you from the server. i.e APIs allow us to connect different devices and applications on the internet. Each time you use applications like messenger, Facebook, Instagram, flight booking application, or check whether using your phone, you are using APIs.
Let us understand the API with an Example.
Whenever we use applications in our mobile phones, computers, the applications that are connected to the internet, API sends data to the server. The server processes that data, interpret it, perform the necessary actions and sends a response back to your device. The application then processes that data, and represents the information to us, in a readable way.
This is how an API works.
Let us understand this with an easy real-life example.
To begin with, let’s consider the example of a restaurant. Imagine that you are going to a restaurant and sitting with a menu of choices to order. The waiter comes to you and you will provide personalized orders like a vegetable burger or cheeseburger with some french fries. The Waiter will pass this order to the kitchen which will prepare your order. After a few minutes, the waiter will come back with your order and deliver it to you. However this process is not that easy as it looks, some processing is done in between.
Here, the waiter plays an essential role as you will neither go to the kitchen to collect your order nor will you tell the kitchen staff what you want all this done by the waiter.
API also does the same by taking your request, and just like the waiter tells the system(Kitchen staff) what you want and give a response back to you.
In addition to this, let me discuss one more real-life example. Similar to restaurant examples, online flight booking also has a variety to choose from, including departure and return dates, cities, and so on. Imagine you are booking a flight online on any airline website and you select departure date and city, return date and city, as well as other variables. To book a flight, we have to interact with the airline’s website to access their database and see if any seats are available on those dates and what the costs might be.
Moreover, if you are not using the airline’s website––a channel that has direct access to the information? Instead, you are using an online travel service, such as Kayak or Expedia, which aggregates information from several airline databases?
The travel service, in this case, interacts with the airline’s API. The API is the interface that, like a helpful waiter, can be asked by that online travel service to get information from the airline’s database to book seats, baggage options, and so on. The API then takes the airline’s response to your request and delivers it right back to the online travel service, which then shows you the most updated, relevant information.
API as Layer of Security.
Mobile phone’s data can never be fully exposed to the server, similarly, the server cannot be fully exposed to Mobile phones. Instead, communication of each is done with small packets of data, sharing only that which is necessary—like ordering takeout. When you go to a restaurant you tell the restaurant what you would like to eat, they tell you what they need in return and then, in the end, you get your meal.
APIs comprise a large part of many businesses’ revenue. Major companies like Google, eBay, Salesforce.com, Amazon, and Expedia are just a few of the companies that make money from their APIs.
Features of API
- APIs adhere to standards (typically HTTP and REST), that are developer-friendly, easily accessible and understood broadly
- APIs are treated more like products than code offering great support to the developers.
- APIs are designed for precise audiences (e.g., mobile developers), they’re documented, and they’re versioned in a manner that customers will have certain expectations of its maintenance and lifecycle.
- Moreover, APIS are much more standardized, they have a much stronger discipline for security and governance, as well as monitored and managed for performance and scale
- As any other piece of productized software, the modern API has its own software development lifecycle (SDLC) of designing, testing, building, managing, and versioning. Also, modern APIs are well documented for consumption and versioning.
- APIs are helpful in planning business models.
- APIs are simple and quickly adopted and can be managed and measured easily.