What Are APIs?

What Are APIs?

Introduction

API stands for Application Programming Interface. It is a software intermediary that permits two applications to communicate with each other. Whether knowingly or unknowingly we use APIs almost daily in our lives. A great way of understanding it is using the Google search bar, when we search something there and press enter, the search result gets displayed.

However, behind the scenes, your search input is sent to the backend via API which connects your search input to a store of information and searches for the result that matches your input.

After that, this data is converted for the user in order to be displayed, and all this happens within a blink of an eye, provided the user has a stable internet connection.

Hence, we can say that the API links the front end of a page to the back end serving as a form of communication medium between the two ends.

Why Do We Need APIs?

Imagine if there were no APIs then it would have been extremely difficult for the server to deliver the information and it might lead to confusion thereby delivering the wrong information to the wrong person. However, when we have an API the entire process takes place systematically.

What is an API Endpoint?

So, in the case of APIs, to request the server, there are specific endpoints that must be called upon to access a particular information called an API endpoint.

In API terminology, an API endpoint refers to a service provider that provides a specific set of functions within the same interface.

How To use APIs?

Being a developer, APIs can be integrated into your application using some inbuilt objects and open source libraries like 'Axios' or 'fetch' in JavaScript.

It's a great practice to read the official documentation attached to the API before making requests to the endpoints. The documentation helps you to get a clear understanding before making API calls in your application.

There are 4 types of actions an API can take:

  1. GET: requests data from the server.

  2. POST: sends changes from client to server; similar to adding information to the server, for example making a new entry.

  3. PUT: revises or adds something to existing information.

  4. DELETE: deletes the existing information.

While making requests to the endpoints, make sure to make the right request to the right endpoint otherwise you'll get an error.

Some Free APIs

Some of the free APIs which I use a lot are:

1) Free API List

2) JSON Placeholder (You can use this one when you want to take fake data for some applications)

I hope that you must have found this article quite helpful. If yes, then do give a read to some of my other articles!

Who knows you might become a great programmer 🤔!