Application Programming Interface, what?

Have you ever come across the term ‘API’ and wondered what it is? Do you have a vague idea of it and wish to know a bit more about it? Don’t fret, I will try to help you out by elaborating the term, stress a little on why they are needed and some of its benefits .

All of us are aware of the importance of efficient communication and how lack of it can create a ruckus in one’s life. It happens to be a deal breaker even in the Tech industry and to oversee this problem come’s into existence the term API.

What exactly is an API?
An API allows applications to communicate with one another. It defines a set of rules that a programmer must follow in order to interact with a programming language, a library or any other tool. Web API’s provide set of rules for interacting with web server, mainly for retrieving data from the database. It is basically a code that governs an access point to a webserver.

Now lets move to the it’s mechanism:

1- Users request some particular information to an API.

2-The API provides an endpoint to the webserver which fetches the requested information from the database and sends the response back to the user through the API.

API requests are made through URL’s using HTTP methods.

Some of the most commonly used HTTP methods include:

GET : As the name suggests, this method is used to retrieve data from the server.

POST : This method is used to send data to a server which helps in creating a resource.

PUT : It updates the target resource with the one that is uploaded.

DELETE : It deletes the specified resource.

The API response would be pure data responses which means it won’t have any presentational overhead that you would expect in graphical user interface like in websites .Here the response sent back by the API is in JSON format. JSON stands for JavaScript Object Notation which represents data in simplest, human-readable format. JSON uses a Key/value format. It can be easily parsed by any programming language with certain libraries serving this purpose. It thus makes an API platform independent and Scalable.

The main difference between an “API request” and “WEB request” is the type of data that you get back in response. A website returns HTML, JavaScript and CSS which work together and display the requested webpage in your browser. Whereas , an API responds with raw data.

But why do we need an API?

Firstly, it allows a developer to integrate any functionality into the existing software without even having the knowledge of its working.

Eg- Applications like Uber/ Ola use maps for navigation simply by using Google maps API. Here, the developers didn’t have to build the navigation system from scratch and the mere use of an existing API saved them the time and effort.

It provides accessibility to the data of different Applications.

Now, lets consider that your organization wants to access data of LinkedIn with all the posts ending with an hashtag of #Jobs . In this case, you can simply mail them and ask for spreadsheet of the same. But then, the organization would have to find a way to import the spreadsheet into the application and even if they manage to store it in there database; the spreadsheet would become outdated quickly.

Instead, if LinkedIn provides an API that meets these demands, it the data would be automatically up-to date and the organization would then receive responses in JSON format which can be easily parsed.

Lastly, it acts like a layer of security over the server. Instead of allowing applications to directly access the data stored on the web server, we now can hide the sensitive data with the help of API and expose only the data that is demanded. It can help build a middleware.

I hope this read was of some value. Also, since this is my first Tech related blog, do revert incase you spot any mistake or even if you happen to like it. :D

Goodbye untill next time!

Take care!

Software Developer at TCS | Information Technology Undergraduate | Sports Enthusiast