Introduction to API

What is an API? The term API is an acronym, and it stands for “Application Programming Interface".

An API is a particular set of rules ('code') and specifications that software programs can follow to communicate with each other. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers. 


Use Case 1: Consider an API as a waiter in a restaurant. Suppose you have a menu of your favorite food and the kitchen is the system where your order is made. But how do you take your order till the kitchen? Correct, you call a waiter, give him/her the order, which in turns takes your order till the kitchen and then your order is made there and then finally, the waiter comes back with your delicious ordered food. Thus, the API is very much similar to the waiter. API is the messenger that takes your order(waiter) and tells the system(kitchen) what to do (to prepare food) and in return gives back the response you asked for (waiter returns with the ordered food). To get more clear understanding, lets shift to another example that will clear your remaining doubts too. 


Use Case 2:Whenever you book a flight ticket, you go to various websites like MakeMyTrip , GoIbIbo , Yatra, etc. You hardly ever go to specific airlines website to book a ticket. Still, you get the plane at the same Air Plane service that you might have booked through the airlines website. So ever wondered how did this happen? Yes, Again, it’s because of the API. 


For example, when you search for flights in makemytrip, the site sends a search request/API call which includes the necessary details such as the date of journey, destination, number of passengers....etc to an API which is hosted by the airline or a third party.  In response, the API sends back the response which contains the flights available on that date to makemytrip.

What is a Web Service?


A Web service is an API that facilitates the communication between two applications over a network. Web service implementation allows two web applications developed in different languages to interact with each other using a standardized medium like XML, SOAP, HTTP etc.
Last modified: Wednesday, 18 December 2019, 11:11 AM