top of page

API, Its Types and Structure

In this post we will talk more about what is API and how it works?

What is API ?

API stands for Application Programming Interface. API is defined as a code that helps two different software’s to communicate and exchange data with each other.

Here are some benefits of using API -

  • Ease of integration

  • Improved services

  • Simple, flexible and quick adoption

  • Faster and easier data exchange

How API works?

Client makes a Request to Server and Server responds back with the data requested in the request.

Types of API

There are four main types of APIs:

Lets talk about each one in detail -


1. Open API -

  • Open APIs, also known as external or public APIs, which are available to developers and other users with minimal restrictions.

  • They may require registration, and use of an API key, or may be completely open. They are intended for external users to access data or services.

  • Public data available through Open APIs. For example, the Indian government offers API "Arogya APISetu"for Transparency or for providing detailed status around the statistics of Corona patients.

  • Data-centric, non-profit organizations make the data available and meaningful for citizen's usage by using open APIs.

2. Internal API -

  • Also known as Private APIs, they are types of APIs that are used only within a single Organization.

  • These are often used to integrate different services and streamline workflows in the Organization.

  • As private APIs aren’t publicly released, they typically aren’t documented in any way that’s available to the general public.

  • Degree of restriction is High.

  • APIs for Accountants’ payroll and HR systems are some of the examples for such APIs.

3. Partner API -

  • These types of API are not open to the public, and access is restricted through the use of specific licenses.

  • The purpose of these APIs is to facilitate B2B activities.

  • Example of a partner API is a recurring subscription service (like Netfilx).

  • Organization can share customer data with an alliance company without jeopardizing the safety of other data components.

4. Composite API -

  • It is combination of two or more APIs to craft a sequence of related operations.

  • Composite APIs are a combination of data and service APIs, that are used to speed up the execution of certain tasks and improve performance. It reduces the overall number of API calls a server has to make thus reducing workload and improving performance.

  • Addressing complex API behaviors becomes easy by using the composite category.

  • An example of this could be a shopping cart for an Ecommerce web application (like Amazon).

  • In the microservice-based architecture, composite APIs are more commonly used because of their ability to make calls to several private APIs at once.

API Stucture

API consist of Request and Response.


Request - it consist of URL, Http methods, Headers and Body.

Response - it consists of Https Response Status Codes, Headers and Body.


In next blog we will discuss more about Http Methods and Http Response Status Code.



Comments


bottom of page