Since the term was first recorded in 1968, Application Programming Interfaces, or APIs, have been around for decades. The concept was initially meant to represent an interaction between a graphics program and the computer system. Today, APIs span the gamut of [microservice](ADD ACRONYM URL), [composite](COMPOSITE DEFINITION URL), and [unified](UNIFIED DEFINITION URL).
APIs aren’t publicly visible. They exist between the front-end application or web interface and the back-end business logic. They are configured to allow requests from the app to be directed to the correct back-end logic. No matter the scale of the operations, this principle holds true.
In this post, we’ll look at the definition of an API, its history, and protocols. Then, we’ll look at a few public API examples and how to find them.
What is an API
The acronym API stands for Application Programming Interface. Today, it represents a connection between computer programs. Merriam-Webster defines it as a set of rules that allows programmers to develop software for a particular operating system without having to be completely familiar with that operating system (1968 definition).
An alternate definition by IBM states an API is a set of rules or protocols that enables software applications to communicate with each other to exchange data, features or functionality. This is a modern definition compared to the Merriam-Webster definition above.
Why APIs are Useful
An API can be seen as a contract or an agreement between the service provider and the developers or services that rely on it. The term was used initially for end-user applications but was broadened to include utility software and hardware interfaces.
APIs:
- Help speed up software development because they allow developers to integrate data, services, and capabilities instead of developing them from scratch.
- Allow information sharing while keeping internal system details hidden.
- Consists of endpoints that receive requests for information or services.
Software services and libraries are the building blocks of APIs. Developers write new code using these libraries.
A Brief History of APIs
The concept of an API was created in the 1940s when Maurice Wilkes and David Wheeler made a modular software library for EDSAC, an early computer. They later published a book named The Preparation of Programs for an Electronic Digital Computer, considered the first book on computer programming with an API specification.
In 1968 the term was first recorded in the Data Structures and techniques for remote computer graphics. They defined it as an interaction between a graphics program and the rest of the computer system.
In 1974 Christopher J. Date introduced APIs to the field of databases in a paper called The Relational and Network Approaches: Comparison of the Application Programming Interface.
The meaning of an API was expanded again in the 1970s and 1980s when remote procedure calls (RPCs) and web APIs were created.
Fast-forward to the 1990s and APIs were redefined as a set of services available to a programmer for performing certain tasks by Carl Malamud, a technologist.
In 2000 Roy Fielding wrote a dissertation that outlined Representational state transfer (REST) and included the idea of a network-based application programming interface In 2001, Tim Berners-Lee, the inventor of the World Wide Web, proposed The Semantic Web and included “semantic APIs” that cast an API as an open, distributed data interface.
The Types of APIs
There are many APIs, but they fall into two broad categories: public and private. Private APIs are developed for organizations and can be used by internal developers and/or partners. Public APIs, on the other hand, can be used by any developer worldwide. Two good locations to see public APIs are in Postman or Github.
Just because an API is public doesn’t mean its code is open source. Sometimes, hundreds of engineers worldwide develop open-source APIs and projects. Whereas, a public API can be publicly or privately developed, even though its APIs are public.
This is a distinction with a difference because organizations like OpenAI, Moneris, PayPal, and RentCast privately develop their APIs and then publish documentation for developers outside the company to use them. In contrast, APIs such as Fabric are open-source and developed in part by external developers on Github.
APIs can be further categorized as libraries, frameworks, operating systems, remote, and web. Operating System (OS) APIs provide services between an application and the OS. Remote APIs manipulate resources through protocols. Web APIs get requests from the World Wide Web. API libraries and frameworks include Google’s client libraries and the Python framework Flask.
API Protocol
An API protocol is a set of rules that govern how software applications communicate with each other. They dictate how data is structured and exchanged and how requests and responses are sent and received. There are four major API protocols to discuss today: REST, RPC, GraphQL, and SOAP.
Representational State Transfer Protocol
In 2000, Roy Fielding wrote a dissertation that outlined Representational state transfer (REST). Today, RESTful APIs are the most commonly known protocol. They transmit information as text through the HTTP protocol. Audio and image files can be transmitted over HTTP but are encoded as text. The encoding format can be JSON or XML.
RESTful APIs have specific architectural requirements that they:
- Use a client-server architecture where the API is the client and the data is stored on a server.
- Are stateless and each request must be independent of all others.
- Can cache data for responses.
- Behave the same whether it has to interact with one or multiple layers.
Simple Object Access Protocol
SOAP, or Simple Object Access Protocol, is a protocol that allows applications to communicate with each other using XML data and HTTP. They use XML data to build messages with a set of structural rules. They are highly standardized and secure and can handle complex data exchanges and validation. They are used in industries that require strict compliance standards, such as banking, healthcare, and government. Get a detailed look at SOAP in this W3C guide.
Remote Procedure Call
A remote procedure call, or RPC, runs functions on a different or remote server. This protocol calls a method rather than attempting to retrieve data from a data source. It can confirm if the function trigger succeeded or failed but won’t return a document. RPC APIs are rarely public and must have high trust and security. An everyday use case is for internally distributed client-server applications.
GraphQL Protocol
GraphQL APIs aren’t technically a separate protocol. Instead, it is a distinct query language with best practices. It uses HTTP, similar to REST APIs, to transmit data in a request payload but with a different approach. GraphQL APIs have a single endpoint with unlimited data schemas. Requests are sent using HTTP POST requests, and data is returned as a schema.
They provide more flexibility within a single query compared to REST APIs. A GraphQL API user must know what data fields are available and can write queries to combine the fields. Therefore, more extensive documentation is required to explain what fields to use to write queries. It’s commonly used for mobile apps, real-time dashboards, and data aggregation. Learn how to use it on this GraphQL website.
API Best Practices
According to this Stack Overflow blog post, a good API should:
- If it returns data, Accept and respond with JavaScript Object Notation (JSON) or Extensible Markup Language (XML).
- Name endpoints with nouns instead of verbs.
- Logically organize endpoints such as product/productid/.
- Handle errors gracefully and return standard error codes.
- Allow filtering, sorting, and pagination.
- Cache data to improve performance.
- Maintain good security practices.
APIs are a big part of a developer’s world. One of the first things they should do is to see if there are APIs available that can be leveraged to reduce the number of lines of code they have to write.
Fun Facts about APIs
Here are several interesting facts about APIs:
- If an API transmits data via the web, it should be RESTful and accept and transmit objects as JSON.
- They are programming language agnostic so that implementation can be in one language while developers can access it in another.
- Numerable frameworks and libraries that can be used to develop APIs today.
- Modern APIs require security, documentation, infrastructure, testing and maintenance, to name a few.
- The International Space Station (ISS) API can return its latitude and longitude, upcoming passes for a location, and the number of people in space.
- The Marvel Comics API allows developers to access Marvel’s library from 70 years ago to today.
- Pokémon provides a RESTful Pokémon API that provides data and serves over 10 billion monthly API calls.
As you can see, developers can use a wide range of publicly available APIs for their projects. You can check out other APIs here and here.
Conclusion
From a simple concept in the 1940s to today, APIs (Application Programming Interfaces) started with a concept that has grown into a world with APIs available for many uses today. They have become essential tools in modern software development, enabling developers to add features to their services and apps or access interesting data like Pokémon and Marvel Comics.
They act as intermediaries between front-end applications and back-end systems, allowing different software to communicate, exchange data, and leverage functionality without exposing internal details.
Over time, APIs have expanded into various types—public, private, web, and remote—and use protocols like REST, SOAP, RPC, and GraphQL. They streamline development, promote interoperability, and power everything from mobile apps to complex services, with widespread applications in the finance and entertainment industries.