What is an API?

Harjot Singh
2 min readFeb 17, 2022

--

Photo by David Pupaza on Unsplash

API stands for Application Programming Interface, and by definition it is a software intermediary that allow two applications to talk to each other.

I know…I know what you’re wondering. What? How? Ugh!!
Yeah I had the same reactions, so let’s simplify this by an example :

Consider yourself in your favourite restaurant and you want to have Shahi Paneer with Tandoori Roti (ok..things started getting yummy :P). The waiter comes to you, take the order and then tell about it to the chef. Chef cooks it and then after it is ready, the waiter serves you your favourite Shahi Paneer.
Now here, You are the customer(customer can change right…so it’s not only you who can make the request)..…the waiter is “the intermediary(API)” who takes your request…the chef acts as the “server” who gives response to the API and then API give the response to you, the customer/consumer.

Now let’s get a little bit technical.
Let’s say you want to book a flight from Delhi to Bangalore. You go to any airline’s website. You make the necessary filters like date, arrival time, departure time, etc and then you search for the flights available. This is you sending request to API. Now, the API sends request to airline’s database with the filters you did. The API then takes the response and delivers it to the travel application you are using. Boom! You have results regarding your request :)
The above figure is the visual representation of how things would be working behind the scenes:

Simple enough?

Moving on…..
Web APIs are the APIs that can be accessed using the HTTP protocol.
There are two types of API architecture:
1. REST (Respresentational State Transfer)
2. SOAP (Simple Object Access Protocol)

More on these later….

Until then, Happy Coding :)

--

--

Harjot Singh

Android Developer @HealhifyMe I lose my handwritten notes often...so now making sure I can find my notes easily :p