Application programming interfaces (APIs) power much of the content we use on the web, as well as underlying much of the communication between software and services in our tech-enabled world. But the term “API” can refer to many types of services, and developers have many choices for how their APIs are architected and what protocols and standards they use.
The API is a powerful and versatile means to connect diverse and disparate software applications. APIs allow a vast array of unrelated software products to integrate and interoperate with other software and data. APIs also allow developers to add features and functionality to software by utilizing a rich array of other developers' APIs. Much of today's enterprise, mobile and web software depends on a wide range of APIs.
There are four types of API
APIs aren’t all the same. For ease of discussion, developers often classify them into types. Understanding these API types can help you determine what your organization needs and then figure out how to get started designing your API.
APIs are broadly accepted and used in web applications. There are four different types of APIs commonly used in web services: public, partner, private and composite. In this context, the API "type" indicates the intended scope of use.
Public APIs :-
A public API is open and available for use by any outside developer or business. An enterprise that cultivates a business strategy that involves sharing its applications and data with other businesses will develop and offer a public API. These are also called open APIs or external APIs.
Public APIs typically involve moderate authentication and authorization. An enterprise also might seek to monetize the API by imposing a per-call cost to utilize the public API.
private or internal APIs:-
are designed for use within a closed group of API consumers, usually a private company or institution. To interact with the data in a private API, a developer typically needs to be actively granted permission to access it, because the data and functionality available through the API are proprietary to the company. Private APIs are often set up with extensive logging and load-balancing capabilities because they must have greater fault tolerance and security than public APIs. They also do not follow the OpenAPI standard as consistently as public APIs. Since private API producers and consumers typically work together closely, data formats can be negotiated based on specific use cases.
A partner API, only available to specifically selected and authorized outside developers or API consumers, is a means to facilitate business-to-business activities. For example, if a business wants to selectively share its customer data with outside CRM firms, a partner API can connect the internal customer data system with those external parties -- no other API use is permitted.
Partners have clear rights and licenses to access such APIs. For this reason, partner APIs generally incorporate stronger authentication, authorization and security mechanisms. Enterprises also typically do not monetize such APIs directly; partners are paid for their services rather than through API use.
Composite APIs generally combine two or more APIs to craft a sequence of related or interdependent operations. Composite APIs can be beneficial to address complex or tightly related API behaviors and can sometimes improve speed and performance over individual APIs.