Types of APIs
API stands for Application Programming Interface, which is a mechanism that allows the interaction between two applications using a set of rules. APIs can be categorised in many categories:
Main/Ownership/Provisioning types of Web APIs
Open or Public APIs: These are publicly available to developers and other users with minimal restriction. They may require registration, use of an API Key or OAuth, or may be completely open. They focus on external users, to access data or services. Example Facebook and Twitter have few Open APIs which you can access using OAuth or API key.
Internal or Private APIs: Also known as Private APIs, only internal systems expose this type of API. These are usually designed for internal use within a company. The company uses this type of API among the different internal teams to be able to improve its products and services.
Partner APIs: are APIs exposed to the strategic business partners. They are not available publicly and need specific entitlement to access them. Example: Payment Gateways APIs like Paypal, PayU. Courier Service API like BlueDart and DHL.
Composite APIs: This type of API combines different data and service APIs. It is a sequence of tasks that run synchronously as a result of the execution, and not at the request of a task. Its main uses are to speed up the process of execution and improve the performance of the listeners in the web interfaces.
Data and service APIs
Beyond the difference between an internal, partner, open and composite APIs, we should mention another approach to categorise APIs:
Data APIs: provide CRUD access to underlying data sets for various databases or SaaS cloud providers. These APIs are needed to serve some fundamental data coming from SaaS application, with help from SaaS connectors or internal data stores.
Internal service APIs: consist in exposing internal services, reflecting parts of internal processes or some complex actions.
External service APIs: are third-party services that can be easily embedded into the existing services of the company to bring additional
User experience APIs: leverage composite APIs to help app developers provide the right experience for each specific device (desktop, mobile, tablet, VPA, IoT).
Web service APIs or API Protocol
A web service is a system or software that uses an address, i.e., URL on the World Wide Web, to provide access to its services.
SOAP (Simple Object Access Protocol): This is a protocol that uses XML as a format to transfer data. Its main function is to define the structure of the messages and methods of communication. It also uses WSDL, or Web Services Definition Language, in a machine-readable document to publish a definition of its interface.
XML-RPC: This is a protocol that uses a specific XML format to transfer data compared to SOAP that uses a proprietary XML format. It is also older than SOAP. XML-RPC uses minimum bandwidth and is much simpler than SOAP.
JSON-RPC: This protocol is similar to XML-RPC but instead of using XML format to transfer data it uses JSON.
REST (Representational State Transfer): REST is not a protocol like the other web services, instead, it is a set of architectural principles. The REST service needs to have certain characteristics, including simple interfaces, which are resources identified easily within the request and manipulation of resources using the interface.
Types of API by Category or Application
- IP Geolocation
- Food & Restaurant
Communication level of APIs
High-Level APIs: High-level APIs are those that we use generally in REST form where programmers have a high level of abstraction and they are only concerned about performing a limited functionality.
Low-Level APIs: Low-level APIs have a lower level of abstraction hence they are most detailed, which allows the programmer to manipulate functions within an application module or within hardware at a granular level. Usually, Low-level APIs are used in sending the real-time video or media feed in response to APIs.
APIs by use cases
APIs can be classified according to the systems for which they are designed.
Database APIs: Database APIs enable communication between an application and a database management system. Developers work with databases by writing queries to access data, change tables, etc. The Drupal 7 Database API, for example, allows users to write unified queries for different databases, both proprietary and open source (Oracle, MongoDB, PostgreSQL, MySQL, CouchDB, and MSSQL).
Another example is ORDS database API, which is embedded into Oracle REST Data Services.
Operating systems APIs: This group of APIs defines how applications use the resources and services of operating systems. Every OS has its set of APIs, for instance, Windows API or Linux API (kernel–user space API and kernel internal API). Apple provides API reference for macOS and iOS in its developer documentation.
Remote APIs: Remote APIs define standards of interaction for applications running on different machines. In other words, one software product accesses resources located outside the device that requests them, which explains the name. Since two remotely located applications are connected over a communications network, particularly the internet, most remote APIs are written based on web standards. Java Database Connectivity API and Java Remote Method Invocation API are two examples of remote application programming interfaces.
Web APIs: This API class is the most common. Web APIs provide machine-readable data and functionality transfer between web-based systems which represent client-server architecture. These APIs mainly deliver requests from web applications and responses from servers using Hypertext Transfer Protocol (HTTP).
Developers can use web APIs to extend the functionality of their apps or sites. For instance, Google Maps API enables the addition of a map with an organisation’s location.