top of page

What are the different types of APIs?


There are many different typologies and classifications of APIs, but the most popular are two: Classification of APIs based on Architecture/Protocols and Classification of APIs based on accessibility/intended use. Let's get familiar with types distinguished by both classifications.

REST API: REST (Representational State Transfer) API is an architectural style for building web services that allow clients to interact with server resources through a uniform interface. REST is an HTTP-based protocol and is the most widely used standard for creating APIs for web applications. In a REST API, each resource is identified by a unique URI (Uniform Resource Identifier), and clients can use HTTP methods such as GET, POST, PUT, and DELETE to perform operations on the resources and typically return data in JSON or XML format. REST APIs are stateless, which means that each request from the client contains all the necessary information for the server to process the request. The server does not maintain any state information between requests, which makes the API scalable and easier to manage. REST APIs are popular due to their simplicity, scalability, and ease of use. They can be accessed from any programming language or platform that supports HTTP and can be easily integrated into web applications, mobile apps, and other systems.

Examples: Twitter API; Google Maps API; GitHub REST API.

SOAP API: SOAP (Simple Object Access Protocol) is a messaging protocol used for exchanging structured information between applications over the internet. It is an XML-based protocol that defines a standard format for messages and uses HTTP or other transport protocols to send those messages between applications. In a SOAP API, the client sends a request to a server using a SOAP message, which is an XML document that includes the method to be called, any parameters required for the method, and any necessary authentication or security information. The server then processes the request and returns a SOAP response, which is also an XML document containing the results of the requested method. SOAP APIs can be more complex than other types of APIs, such as REST APIs, due to their reliance on XML and the need for additional security measures. However, SOAP APIs are still widely used in enterprise-level applications and systems, where the standardized message format and security features can be beneficial.

Examples: eBay Trading API; PayPal SOAP API.

GraphQL API: This is a newer type of API that was developed by Facebook. It allows clients to specify exactly what data they need and receive that data in a single request. This makes it more efficient than traditional REST APIs, where clients often have to make multiple requests to fetch all the data they need. With GraphQL, the client specifies the desired data structure using a query language, and the server responds with a JSON object containing the requested data. The server defines a schema that describes the data available, and the client can query that schema to retrieve data. The schema can also define mutations, which are operations that modify data on the server. GraphQL has gained popularity due to its flexibility, efficiency, and intuitive nature, which allow developers to easily retrieve only the data they need, reducing network traffic and improving performance. It also allows for strong type checking and schema validation, which helps catch errors early in development.

Examples: Facebook Graph API; GitHub GraphQL API; Shopify API.

Private APIs: also known as Internal APIs are used within an organization or system to enable communication between different parts of the same system. They are not exposed to external parties or third-party developers, and their main purpose is to facilitate integration and collaboration between different parts of the internal system. Internal APIs may not have the same usage limits or documentation as public APIs, as they are typically only used by internal developers who are familiar with the system.

Public APIs: also known as Exposed APIs or External APIs are designed to be used by external parties or third-party developers to access the functionality of an application or service. These APIs are made available through a developer portal or documentation website and are often subject to usage limits and terms of service. The main goal of public APIs is to enable developers to build applications that can communicate with and leverage the functionality of the underlying application or service. All examples of APIs that we have given above in the Classification of APIs based on Architecture/Protocols are examples of public APIs: Twitter API; Google Maps API; eBay Trading API; Facebook Graph API.

There are many different typologies and classifications of APIs, but the most popular are two: Classification of APIs based on Architecture/Protocols and Classification of APIs based on accessibility/intended use.

According to the Classification of APIs based on Architecture/Protocols, the following types are distinguished: REST APIs; SOAP APIs; GraphQL APIs. These are just a few examples of the many different types of APIs based on architecture/protocols. The choice of API architecture or protocol often depends on the specific needs of the application or system being developed, as well as the skills and preferences of the development team.

According to the Classification of APIs based on accessibility/intended use, the following types are distinguished: Private APIs; Public APIs. Public APIs are designed for external developers to access and use the functionality of an application or service, while internal APIs are used internally within an organization or system to facilitate communication and integration between different parts of the system.

116 views

Recent Posts

See All
bottom of page