DEV Community

Cover image for What Is API
christopher
christopher

Posted on

What Is API

An API, or Application Programming Interface, is a set of rules and tools that allows different software applications to communicate with each other.

API is when you are making an order to a system. It’s requesting the server.
If we go by the definition provided by Wikipedia, it states the following:

“In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software. In general terms, it is a set of clearly defined methods of communication between various software components”

It is correctly defined, but still, the meaning is unclear. So let’s understand it with the help of one small example.

Consider an API as a waiter in a restaurant. Suppose you have a menu of your favourite food and the kitchen is the system where your order is made. But how do you take your order to the kitchen? Correct, you call a waiter, give him/her the order, which in turn takes your order to 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 clearer understanding, let's shift to another example that will clear your remaining doubts too.

Have you ever visited any sites that show an option for signing up through Facebook or Google? How do you think you can log in and proceed ahead with the application without ever worrying how that code was written!?! It’s because of the API that has simplified all your work. So all the information being provided for Google sign-up is done through the API.

But good things require precautions and some measures to remain good. So do the API’s!

Since most of the APIs are provided for free, it need some kind of security to keep it safe from various non-productive purposes. Hence, a new concept called API key was introduced. This key can be considered as permission that you take from the supplier, like from Google, to use their API for signing up on your website or any other application.

There are some API’s that are free to use, but some APIs need to be bought.

So in the last, Let me ask you one question: Whenever you book a flight ticket, you go to various other websites like MakeMyTrip, GoIbIbo, Yatra, etc. You hardly ever go to a specific airline's website to book a ticket. Still, you get the place at the same Air Plane service that you might have booked through their website. So ever wondered how this happened?

Yes, Again, it’s because of the API. Gosh! You think you could survive without this. Don't forget to thank your superhero – the API, who manages all your queries without any complaints and returns with the appropriate result. It has made your life much simpler and easy. This superhero is great!

How to Use API

I hope you got the real meaning of it! No TextBook language :)

Top comments (0)