In this article, we’ll provide an overview of the API types within these two distinctions, as well as a couple of things someone might mean when they say “API.”
APIs are integral to all software projects, yet the acronym doesn’t have a singular meaning. Yes, it stands for “Application Programming Interface,” but people use that term broadly. There are many types of APIs and even multiple ways of viewing those types. For example, some distinguish between interface styles, while others refer to the API audience.
Prominent API Interfaces
Every “Net API” (as Matthew Reinbold calls them) transports information from server to client. How this is accomplished varies depending on the interface.
The most-discussed interfaces include:
- SOAP (Simple Object Access Protocol) utilizes XML, high security, and any transport protocol.
- REST (Representational State Transfer) affords scalability, fast speeds, and any data type.
- GraphQL is a query language using one endpoint to support flexible responses.
SOAP was the first industry-standard but has since lost favor to the newer interfaces. REST’s straightforward implementation makes it a favorite among external and partner APIs. Some may also mention XML-RPC and JSON-RPC, which sit somewhere between SOAP’s remote procedure style and the less standardized REST.
GraphQL is the newcomer, having been publicly released in 2015 by Facebook. While used in some public APIs, it is most commonly found with internal integrations.
While each interface has advantages and disadvantages regarding how the API operates, who is using the API is another vital factor to consider.
Common API Audiences
Knowing your consumer is essential to success. In the last section, I mentioned three different API audiences and how they sometimes influence the interface type. Let’s look a little closer at API audiences.
You’ll typically see three audiences come up in conversations:
- External APIs are documented publicly and are accessible to all
- Partner APIs are created between business partners to mutually benefit
- Internal APIs are used privately by a company to incorporate software
External APIs, also called public APIs, are easily adopted and widely accessible (though may require payment or paid accounts). Partner APIs create a channel for different institutions to share information. Often, there is a business relationship that exists before one party integrates with the other. Internal APIs are used solely within the same organization, though may be used between different groups within the same company.
The diversity in audiences helps us differentiate the types because many design, security, and economic choices hinge on the target consumer.
Operating Systems and Libraries Also Have APIs
Finally, I need to mention other types of APIs, though recognize that these are unlikely the ones referenced in much of the Net API talk you see. For the sake of completeness, it’s worth discussing operating systems and programming libraries. In addition, they provide patterns that are still implemented in Net APIs.
Operating System APIs provide the hooks to help programmers of local software tap into the features of the machine and its OS. While very different than Net APIs, there are still considerations about usability and security.
Programming languages also provide interfaces, either standard or expandable via a module architecture. These are used to access functionality, such as dates or other data structures. While these APIs also exchange data, they typically do so without making any network connections.
Learn API Design
Regardless of the type of API, you should think carefully about your design. The interface and the audience should both be part of the discussion. In addition, you may even find yourself building a programming library. These SDKs or client/wrapper libraries make it easier to access an API from the supported programming language.
Explore API Academy’s Design Archives to ensure the types of APIs you build are easy for developers to use.