Real life example of an API: Suppose, we are searching for a hotel room on an online website. In this case, you have a vast number of options to choose from and this may include the hotel location, the check-in and check-out dates, price, accommodation details and many more factors. So in order to book the room online, you need to interact with the hotel booking’s website which in further will let you know if there is a room available on that particular date or not and at what price. Now in the above example, the API is the interface that actually communicates in between. It takes the request of the user to the hotel booking’s website and in turn returns back the most relevant data from the website to the intended user. Thus, we can see from this example how an API works and it has numerous applications in real life from switching on mobile phones to maintaining a large amount of databases from any corner of the world. There are various kinds of API’s available according to their uses and applications like the Browser API which is created for the web browsers to abstract and to return the data from surroundings or the Third party API’s, for which we have to get the codes from other sites on the web(e.g. Facebook, Twitter).
Types of APIs: There are three basic forms of API-
Few other types of APIs:
Restrictions of using APIs: When an API is made its not really released as a software for download and it has some policies governing its use or restricting its use to everyone, usually there are three main type of policies governing the APIs, those are:
Advantages of APIs –
Disadvantages of APIs –
My Personal Notes