What is an API ?

What is an  API ?

Table of contents

No heading

No headings in the article.

To start with an API means an Application Programming Interface. It is a software program that serves as a means of communication between two applications. Apis serve as a means of retrieving and sharing data within or across an organization.

An API is like a middleman between two clients. It gets requests from the client or user, analyzes that request before sending it back to the server and in turn it gets a response from the server and sends it back to the client.

Apis are all around us, cases such as an e-commerce site when you search for a product, filter a product or pay for a product through payment gateways from your phone, all these use APIs. Consider the illustration below.

A restaurant has a waiter(API), customers(users) and chefs(servers). The customer asks the waiter for an order, and the waiter then takes the order and sends it to the chef over the counter, now the chef checks if that can be made available via the fridge or the pots or shelf(database). Depending on the response from the chef, that order is now sent back to the waiter either as food (meaning the request was found) or as just information to tell the customer(client) that food(request) isn't available.

So in all APIs are used a lot today to serve communication purposes. Almost every organization uses an API and so it is crucial for developers to either know how to consume an API or create an API.