An application programming interface (API) is a piece of code that acts as an intermediary between two different pieces of software and enables them to communicate with each other. Or in other words, it’s a user interface for software instead of a person.
Software developers have used APIs to integrate software for decades (for example, developing an application for operating systems like Microsoft Windows requires an API). However, APIs are quickly becoming the cornerstone of the software and hardware markets because of the ways they can speed up the development of cloud-based technologies and help businesses provide better customer experiences.
Here’s how APIs work in simple terms, as well as how businesses could stand to benefit from using them in the software development process.
How APIs Work (in Plain English)
An API works similarly to how a waiter or waitress acts as an intermediary between the kitchen and customer in a restaurant. When a customer visits a restaurant and places an order, the waiter (our API) translates and relays the order from the customer to the kitchen (the services that the customer wants to access). Then, the kitchen prepares the meal, and the waiter delivers it to the customer as requested.
Similarly, when you visit the website of a SaaS product and log in via a social media account, an API relays your request to the social network of your choosing, verifies your identity, and then returns that verification to the backend services you’re trying to access.
This process is beneficial for both you and the web app you’re trying to access because it simplifies the process — you don’t need to navigate the inner workings of a restaurant kitchen to get a hot meal, and the kitchen staff doesn’t have to take your order while also trying to cook.
The Benefits of APIs (and the API Economy)
While the restaurant scenario above is a good example of how an API works, the electrical outlet in your home is a better illustration of how APIs ultimately save businesses time and money on software development.
Much like an outlet provides easy access to the electricity that powers appliances like your refrigerator, APIs enable developers to access services or data from a piece of software without coding the connection manually (which would be the development equivalent of hardwiring your refrigerator directly to your home’s breaker box). As a result, APIs allow developers to integrate functionality or services into applications much faster than they would if they tried to hard-code them.
APIs can also reduce the amount of time and money required to scale a piece of software. Since the plug-and-play nature of APIs abstracts the functionality of a piece of code, it makes it possible to componentize common software functionality into building blocks businesses can use (and reuse) to develop applications rather than coding that functionality from scratch each time.
The API Economy
The componentization of software made possible by APIs has given rise to a growing economy of microservices businesses can purchase and incorporate into their applications. For example, rather than building an identity and access management (IAM) system from scratch, a business can simply purchase access to an identity-as-a-service (IDaaS) provider’s API and connect their application to it (like plugging a new lamp into the wall).
As a result, businesses that build software via third-party APIs are often better suited to respond to changes in their marketplace because they can build and launch complete applications faster than if they tried to do it all in-house.
Purchasing an external API can also reduce maintenance overhead since maintaining the API’s functionality is the responsibility of the service provider (similar to how the utility company — rather than you — is responsible for maintaining the equipment used to generate electrical power). This also helps businesses improve agility by enabling them to focus limited development resources on the functionality that differentiates them from their competition rather than building and maintaining the basic functions that every app needs.
API Monetization
In addition to the benefits that APIs offer businesses through the software development process, they also present an opportunity for businesses to leverage their data and internal tooling into new revenue streams and business opportunities. Some of the world’s most well-known companies (Amazon, Google) generate a portion of their revenue by selling access to their APIs.
Businesses often monetize their APIs for reasons other than revenue as well, such as encouraging customer loyalty or gathering data that helps improve the customer experience. For example, Slack’s API makes it easy for businesses to integrate Slack’s messaging tool into other applications they use, which in turn helps Slack become more integral to their customers’ business.
Some businesses also offer APIs to the public for free, using them as a marketing tool that drives awareness or as a way to explore new business opportunities by providing developers access to their data and observing the ways they use it.
Examples of API Uses
If you own a smartphone or use a software-as-a-service (SaaS) web app, there’s a good chance you’ve used one or more APIs today already. Some of the most common APIs people use on a regular basis are below.
1. Google Maps API
Over a billion people use the Google Maps app to navigate the world around them every month. But the Google Maps API also allows other companies to integrate Google Maps functionality into their own software or services without having to develop that functionality from scratch themselves.
For example, Uber uses the Google Maps API to help drivers and riders find each other, plan the fastest routes through traffic, and optimize shared rides (in fact, much of Uber’s platform is built from API calls rather than custom code).
2. Weather API
There are many weather APIs available today (both free and paid) that developers can use to add weather information to applications, websites, and more without having to build those services themselves from scratch. For example, the National Weather Service has an API that “allows developers access to critical forecasts, alerts, and observations, along with other weather data.”
3. Spotify API
Over 345 million people use Spotify to listen to music, and the Spotify API makes it possible for developers to integrate music data, playback controls, and other services from Spotify into external applications. For example, the song recognition app Shazam uses the Spotify API to help their users find a song they saved on Shazam in Spotify (so they can add it to their favorite playlist, for instance).
4. Auth0 API
Similar to how the Google Maps API lets software companies integrate Google’s map services into their own applications, Auth0’s API allows software companies to integrate IAM services without having to build them in-house from scratch. For example, Autotrader used Auth0’s API to integrate secure authentication into a personalized car buying experience for their users in just a few days.
5. Twitter API
Twitter has over 330 million active users, each sharing opinions, starting conversations, and engaging with audiences. Their platform has a substantial amount of data on the types of conversations that are garnering attention, and their API provides access to that data so organizations can analyze conversations and engage with them more effectively.
SOAP and REST APIs
Most APIs follow a standard set of rules that determine how two pieces of software communicate with each other, like how appliances in your house are designed to work with the voltage that the utility company provides in your region of the world.
However, similar to how the socket/plug configurations change depending on the country you’re in, APIs can present themselves in a couple of different ways:
- Representational State Transfer (REST) APIs. REST APIs (sometimes referred to as RESTful APIs) use the JavaScript Object Notation (JSON) programming language and a URL structure to govern the communication between two pieces of software. REST is used by most major API providers because it’s developer-friendly. But it won’t work if your software isn’t web-based.
- Simple Object Access Protocol (SOAP) APIs. SOAP APIs use a programming language called Extensible Markup Language (XML) to govern the communication between software. SOAP is not as developer-friendly as REST and, therefore, less common.
It’s worth noting that there are technical differences between REST and SOAP APIs, which means that an apples-to-apples comparison isn’t exactly accurate from a developer’s perspective (REST is technically an architectural style, whereas SOAP is a protocol). However, from a business perspective (especially for SaaS providers), working with REST APIs generally makes a developer’s life easier than working with SOAP APIs.
Other Types of APIs
While the APIs and API economy are both growing in prevalence and usage, not all APIs are presented as services that are available for purchase. In fact, many companies use APIs internally to build tools for their teams and partners. Here are several other types of APIs in use today.
Open APIs
Open APIs are often referred to as public APIs or external APIs because they’re specifically designed for external use with few (if any) restrictions. While some open APIs are entirely free for the public to use (like Spotify’s API), some are also provided as a service/product you have to pay for. Some businesses even offer open APIs as a way to find new business opportunities or monetize their data.
Private APIs
Private APIs are designed to be used for software development within an organization and are not available for use by developers outside the organization (excluding authorized contractors). Enterprises commonly use private APIs to build and scale internal software tools or build business automation that helps them streamline and scale business processes.
Web APIs
A web API (also commonly referred to as a web service) is an API built specifically to provide software services over a network, usually to a web browser or server. Facebook has a web API that provides access to Facebook’s data and services to other software providers over the internet.
Partner APIs
Partner APIs are designed to be used externally like open APIs, but access is often limited to strategic business partners as a way to generate revenue for both parties. Partner APIs are often used similarly to how businesses use referral marketing or affiliate marketing. For example, Shopify offers a partner API that enables their partners (developers and designers who build Shopify sites) to access the data from their Partner Dashboard and use it to help the Shopify stores they work with.
APIs Power Agility and Growth
There are tens of thousands of APIs available for use today, each providing access to pre-built functionality your business can use to improve customer experiences faster than trying to build that functionality in-house.
For example, Auth0 some customers report seeing 2-3x increases in conversions after integrating IAM functionality into their applications with our API (in addition to the time and money they save on development costs when compared to building an IAM solution in-house).
Auth0’s API are open-source and easy for your developers to experiment with to determine whether it will provide the ROI your business needs. Learn more about Auth0’s APIs here.
About the author
Diego Poza
Sr Manager, Developer Advocacy