API stands for application programming interface. They’re a way for digital systems to interact with each other and exchange information over the internet. APIs differ from user interfaces (UIs). While the user interface allows communication between a system and its end users, APIs provide a way for developers from one system to make use of the resources and capabilities of another computer system.
The document that guides developers on how to make that software-to-software interaction is called an API specification. And this document is often written by technical writers.
Below are some popular types of APIs you might encounter as a technical writer.
SOAP: SOAP (i.e., Simple Object Access Protocol) APIs are web services that use the XML Information Set (XML Infoset) as their format for exchanging data. The XML Infoset is a file that specifies the set of information items, such as Document Type Declaration and Attribute Information Items, that should be included in a valid XML document.
REST: Representational State Transfer (REST) is an API that lets you make requests for resources through URLs. With REST, you can perform CRUD (create, read, update, delete) operations on web resources using the HTTP methods
GET
,POST
,DELETE
,PUT
,OPTIONS
, andPATCH
. This is the most common type of web API. And its responses are usually returned in JSON or XML format.RPC: RPC stands for Remote Procedural Call. It represents a class of APIs that allow developers to make function calls on a remote server as if the server were in their local machine. With RPC APIs, developers can call functions on another computer without dealing with the nitty-gritty of how the data travels across the network. The functions (or methods) on these servers can be in any language. Like REST and most other web APIs, RPC uses HTTP protocol for its data transfer.
gRPC: gRPC is an open-source remote procedural call API developed by Google. gRPC-based APIs do the same thing as the RPC APIs: they call functions or run procedures on remote servers. The only difference is that, while RPC uses XML and JSON as its message exchange format, gRPC uses protocol buffers (specified in a .proto file). Like JSON, protocol buffers let you define how you want your data to be structured and converted as it is being sent across the network.
GraphQL APIs: GraphQL provides a complete and intuitive description of all the resources available in the API, giving developers the ability to ask for exactly the information they need and nothing more. Unlike REST (which usually has as many interaction points as the category of data available), GraphQL provides users with a single point to access all the resources in the API.
Voice Assistant APIs: Voice Assistant APIs are the brains of smart speakers and voice assistants like Amazon’s Alexa and Apple’s Siri. They let developers create apps or services that, through natural language processing, understand and respond to voice commands spoken by the user. When you ask Alexa to play you a song or tell you about the weather, Alexa uses a voice recognition API to understand your intent and fetch the info or perform the action you asked for.
WebSocket APIs: In a traditional HTTP transaction, the user's job is to send requests to a server, and the server’s job is to fulfill those requests. It's a bit like asking a question and getting a single answer each time. Once the server responds, the connection closes. And if the user (called client) wants more data, she has to send another request, starting the process anew. WebSocket APIs make it possible to keep a constant connection between the client and server until the server has some new data to push to the client. Instead of sending individual requests, the client and server establish a continuous connection that allows them to send messages back and forth at any time without having to make new requests each time. This allows real-time data transfer and is suitable for applications that require continuous updates, like chat apps and online games.
IoT APIs: Internet of Things (IoT) simply refers to the growing number of gadgets, or "things," that connect to the Internet and communicate with other devices and services on the network. Smart fridges, smart TVs, smart copiers, smart thermostats—these internet-enabled devices (often with "smart" in their names) can generate and transmit data over the internet using IoT APIs. In other words, IoT APIs allow devices like electric cars and smart fridges to talk to each other.
As you may have noted, these APIs all serve different purposes. The choice of what API type to use or focus on often depends on what you want your app to do, the data requirements, performance needs, and your team's preferences or constraints. And now, knowing their strengths and weaknesses, you're better equipped to make informed choices about which one is appropriate for a given use case.