What is an API?
Have you ever been in a hotel or a resturant? You must have! There you must have taken the advantages of the services offered by a waiter. A waiter is someone who takes your order, forward the order to the hotel kitchen and than serves back you the requested food item. Well, an API is much similar to that.
Application program interface (API) is a set of routines, protocols, and tools for building software applications. An API specifies how software components should interact.
There are many different types of APIs for operating systems, applications and websites. When you visit a website now-a-days you must have seen, that they have multiple sign up options like: Sign up with Facebook, Google, LinkedIn etc. Well this is the most common use of API these days. Here is a list of some commonly used APIs:
- Google Map API: Google Maps API lets developers embed Google Maps on webpages.
- YouTube API: Allow you to integrate YouTube videos and functionality in your own webpage.
- Social API: It includes APIs like Facebook, Twitter, LinkedIn, Reddit etc. They provide you access to public data of their registered users using API.
When we said before, that API is like a waiter, we meant that it doesn't let you to know, how the method or the procedure functions, by which the requested dish is prepared. It only brings you the prepared dish irrespective of the technique used to prepare it. Similarly, say you requested some user data through a social API. So, the API requests the web service(say Facebook) on your behalf and make the appropriate request to the Facebook server and returns back the result to you.
Advantages of using API
Some advantages of API are as follows:
- Security: using API of a third party provider(like Google etc) for logging and sharing data in some other web application is a lot safer.
- Automation: APIs enable and facilitates automation process with great ease. You can use API of some web service in your own code to automate tasks like checking your timeline, posting a message etc.
- Integration: APIs allow content to be embedded from any website or application more easily. This guarantees more fluid information delivery and an integrated user experience.
- External DataBase Access: APIs allow website visitors to access remote, password-protected databases. Your API password and username authorizes permission for information to be exchanged between your website and the API's database-driven resources.