The world has been more connected than ever before. Now, anyone can purchase airline tickets, book restaurant reservations, look for freelancer, and buy food online. But how can we make all of this possible? Perhaps, when you ask programmers or developers, you might hear them answer, all those services are made possible because of this thing called “API”. So, you might be wondering, what exactly is an API?
API stands for Application Programming Interface, it is a software intermediary that allows different applications to communicate and offer service from one application to the other. An API connects platforms or programs, to make requests and communicate data between them. An API may refer either to the specification or to the implementation. In comparison to a user interface, which is an interface that connects a computer to a user, an API is an interface that connects computers or pieces of software to each other. With that, an API is not intended to be accessed directly by an end-user. Only the app or software developer has direct access to the API.
An API is often made up of different parts which act as tools or services that are available to the developer. A program or a developer that uses one of these parts is said to “call” that portion of the API. The calls that make up the API are also known as subroutines, methods, requests, or endpoints. An API specification defines these calls, meaning it provides a set of standards and protocols for implementing them, i.e. how to use APIs for building and integrating application software. A computer system that meets this standard is said to have implemented or exposed an API.
Each time you log in into an app like Facebook or Tinder, order food delivery, reserve plane tickets, or check the weather or traffic on your phone, you are using an API. Here, API serves as the interface between the app and the service that you wanted to use. API interprets the data you input, performs necessary action, and presents you the information you need in a presentable manner, without you having the need to understand all the processes that happen in between.
A common analogy to describe an API is a waiter in a restaurant. When you go to a restaurant, you interact with the waiter in order to get the services offered by the restaurant. You can order food and drinks, ask questions about the menu, ask where the washroom is, request and pay the bill, and inquire for other restaurant services. In this analogy, the waiter shields you from all the complicated stuff that happens behind the scenes. You don’t have to worry about recipes, cooker, restaurant’s floor plan, calculating the expenses, or serving food and drinks, etc.
The waiter is the interface between you, the customer, and all of the restaurant’s services. The waiter provides a way for you to interact with the restaurant, without bothering yourself with all the complex processes happening in the restaurant. Through this waiter analogy you can intuitively understand the use and importance of APIs.
4 main uses of APIs
1. API simplifies provision of services
As illustrated by the restaurant example, you don’t have to know how to cook a perfect pasta to have one, you just have to order from the waiter. A real-life example of API would be the operating systems on our computers and smartphones. With the APIs integrated in the OS of our devices, app developers won’t need to worry about setting up a WiFi connection, or communicating to the various built-in sensors in our devices like camera, GPS, or accelerometer. The APIs provided in the OS give developers a simple method to do all of this. The app doesn’t have to worry about what kind of device it is running on, or what hardware it has, or what is its screen resolution, or any type of settings.
This is the beauty of using an API, it lets a product or a service communicate with other platforms without having to know the details of how exactly the service performs its task. This makes app development simpler, more efficient, and more flexible. Furthermore, it helps developers to focus on developing new innovative tools, products, or services instead.
2. API allows access to data from third parties
In the restaurant example, the waiter can provide you information on the status of your order, without the hassle of going to the kitchen to get the information yourself. A real-life example would be the weather app on your smartphone. You see, Google or Apple neither built weather satellites on their own, nor installed temperature sensors all over the world. Instead, these weather apps use the API of third-party services, e.g. The Weather Channel, to retrieve weather data and forecasts. API’s allow different apps and services to share and exchange information.
In this age, almost all services use shareable information through an API. There are API’s to lookup plane schedules, stock prices, movies, lyrics, recipes, zip codes, traffic conditions, parking spaces, public holidays, and more.
3. API’s extend functionality
Again as illustrated by the restaurant example, when a customer has special events like birthdays, the waiter can provide additional services such as playing a birthday song or giving a complimentary birthday cake. A real-life example would be, apps can have a capability to show a widget on the phone’s notification center. Here, the app notifies the system through an API that it has an available widget. And when the user adds this to the notification center, the system will contact the app to ask how the functions will be displayed on the widget.
Another example is smartphone personal assistants, like Siri, Google Assistant, or Alexa. Developers can use the assistant’s API to extend their functionalities. For example, personal assistants can be integrated into “smart appliances”, like smart lights. Once integrated, the personal assistant, through its API, will be able to know how to interact with the hardware of the smart appliance and perform its task.
4. API’s serve as gatekeepers
Going back to the restaurant example, when the restaurant is full or have table reservations, the waiter acts as a gatekeeper, informing incoming customers that the restaurant is currently in full capacity or have tables booked in advance. A real-life example would be, those pop up messages you encounter on your smartphone asking for permission to use your location, camera, or microphone. Every time your phone asks you for permission, this is an indication that the app is using an API of the system. API’s that get your location are usually centralized, hence this makes it easy for any mobile platforms, like iOS or Android, to notify you when your app is using your location.
Another example would be using your Google or Facebook account information to login to another website or app. This authentication service is fast and convenient. But by doing so, we are also giving the website or app the permission to access some of our private data like our name, email address, photos, etc.
In both examples, these kinds of permission requests are privacy sensitive, so, in case you don’t want to give your permission, you can simply deny the request. Such features allow us to have more control and protection on our personal data. However, the common problems are, most of the time these permission requests are asked only once, and most of the time the effect of these permissions is long lasting and people normally forget which apps or websites are given permission to access our data.
3 types of APIs
There are 3 types of APIS based on their release policies.
1. Private or Closed API
Here, the API is used only internally. This policy gives companies greater control over their API interactions and solutions.
2. Partner or Shared API
Here, the API is shared within specific business partners. This policy can provide additional revenues to the company without having to expose the API to the public. Hence, having more control over the quality of the API development.
3. Public or Open API
Here, the API is made available to everyone. This policy allows any third party programmer to interact with the API and develop solutions with it. This opens opportunities for more collaborative innovation.
To maintain the competitiveness of your business, it is important to promote rapid and relevant innovations. Businesses need to respond quickly to rapid changes in technological demands. In this kind of setting, it will not make sense anymore for businesses to restrict the development of new technologies and services on their own, simply to keep the profit just for themselves. To have more impactful and scalable innovation, nowadays, it is considered that an open collaboration approach is the way to go. In the context of API, this translates to a push towards Open API.
With an open API, a company does not need to depend solely on their own internal knowledge, technologies, and resources to create new products or services. Instead, the company can get additional inputs from collaborating with external sources, such as other companies, startups, universities, or even individual programmers. Open API provides opportunities for businesses and IT teams all around the globe to collaborate, further simplifying the integration of new applications into any existing architecture and creating new innovative solutions.