What is an API? A brief introduction

API stands for Application Programming Interface. It acts as a simple interface that allows two applications to talk to each other, where communication is initiated by one application/end. Let’s understand this using a simple analogy, and I am sure you are aware of Skyscanner or Trivago’s website, which lets you find and compare all the flights and hotels based on your needs. Have you ever given a thought to this, how it works? How can Skyscanner retrieve all the flight’s details along with its price between specified source and destination? Or How Trivago can compare all the hotels across all the websites? It’s where API comes into the picture. Assume it’s not for this API, then an operator at the Skyscanner or Trivago has to email every airline or Hotel company to get their price list. So anytime we want to book a flight or hotel, we open the Skyscanner website, and we fill in all the required details, and boom, we see the information of all the available flights. In the background, an API call is made to all the Airlines company whose result is shown on the Skyscanner website.

API is acting as an interface between the Application and its backend.

Web API and its types:

As the name suggests, it is an API that can be accessed using Web protocol, i.e., HTTP. It includes the APIs used to communicate with the browser. Different web API’s differs in terms of security and usage, which are described below:

  1. Open APIs: These are also known as Public APIs. These are available to everyone with no or minimal restrictions because these are intended to be used by external users to access the data or services. For example, Developers can use weather API and integrate the weather information within their application.
  2. Internal APIs: As the name suggests, these are hidden from the public and intended to be used within an organization to share the resources. For example, the HR department needs to know the salary of an employee; hence they need to access the finance data for an employee.
  3. Partner APIs: These are similar to the first type, i.e., Open API’s but their nature is more restrictive than Open APIs. They are used for a specific purpose, such as providing access to a paid-for service.
  4. Composite APIs: As the name suggests, the composite meaning “made up of several parts or elements.” Hence it allows developers to access several endpoints in one call. These are useful where a user requires information from multiple services to implement a single task. For example, to order from an eCommerce website, several inputs are required like customer ID, item, quantity, etc. all are mandatory details needed to place an order, in short, achieve a single task.

2 thoughts on “What is an API? A brief introduction”

Leave a Reply