What is an API?
An API (application programming interface) is a set of functions and procedures that enables software to access the data and features of another application.
What does an API do?
- Defines the rules and syntax of making requests to an application from external software.
- Separates the private implementation of a program from its publicly accessible methods.
- Provides access to useful functions and data through a simple programming interface.
- Allows vastly different systems to communicate through a common bridge.
- Opens new revenue streams through monetizable third-party access to business functions.
How departments can use APIs
Marketing departments can use public APIs to gain useful insights into markets.
Major companies like Google, Facebook, and Twitter all offer public APIs that enable software interaction with their products. These can be remotely accessed programmatically to get up-to-date information on trends and users.
The data returned from making calls to these APIs can be used by your company’s software. For example, a company could write a program that checks which phrases are trending on Twitter, using calls to Twitter’s API. A marketing department can use this processed data to better understand markets and make data-driven decisions.
Website development teams can use APIs to quickly build rich websites without reinventing the wheel.
Website development uses many APIs. For example, instead of building an entire map application from scratch, developers can use the Google Maps Platform API to include a map on a website with just a few lines of code. Similarly, they can include comments from Facebook by interfacing with the Facebook Graph API, or include up-to-date product details from Amazon with the Amazon Product Advertising API.
Sales teams can offer more value to third parties by offering API access to company resources.
Offering limited access to some business functions via an API can greatly extend the functionality of your product lineup. Instead of retailers, third parties, and affiliates contacting your company’s personnel directly, an API can be used to transmit information from your company’s systems to theirs and vice versa. This makes communication much faster and more efficient.
For example, a ticketing company can offer API access to affiliates so they can book tickets without having to phone. Instead, the affiliate’s software makes API calls that check availability and book tickets.
Features and benefits of APIs
APIs make it easy for programmers to use features of complex systems.
An API defines some easy-to-understand methods programmers can use to make use of complex systems. Programmers can do this knowing nothing about how those systems are actually implemented under the hood.
For example, a developer can add a button to their application with just a single line of code that’s defined in the API specification. The software library does all the hard work of translating the written line of code into a button that appears on the user’s screen, and all the developer needs to know is the right syntax for the API call.
APIs work as a bridge between completely different software systems.
Software is built using a staggering number of different tools, languages, physical resources, and methods. It’s unreasonable for programmers to learn them all or for software systems to be expected to interface with them all.
APIs allow considerably different systems to communicate with each other through a relatively simple common language.
For example, your company could have a bespoke database application that’s written in an outdated language like COBOL. Instead of requiring interested parties to learn the intricacies of your archaic system, you can instead offer API access through a language that’s more commonly used today, such as XML.
The programmer can use any programming language they choose and only has to code for the simple XML your API exposes. They are able to access and use all the important data in your database, while neither you nor the third party need to know anything about how the other system works internally.
APIs keep the implementation of systems private.
Giving third parties direct access to your business resources would be risky. There are many details that companies need to keep secret about how their most important assets work to remain competitive. If everyone could see how your company’s systems work, they could easily copy your innovative ideas.
APIs solve this issue by only exposing the information you’re happy to share. People using an API rarely get to see behind the curtain and can only access a finite set of functions you’ve carefully curated.
Furthermore, APIs often have tight security, authentication, and logging, so you can always be sure the right people are accessing the data they’re authorized to.
APIs facilitate the automation of tasks.
By exposing a set of methods for software systems to make use of, automation is possible. Thanks to APIs, two or more pieces of software can perform tasks together without human interaction.
Consider a simple application like a database to store the details of a website’s members. You could personally store the names of members in a spreadsheet and manually update it every time a new member joins, but this quickly becomes incredibly time-consuming.
Instead, by making API calls to the database, the website software can update the database itself, automating the entire process.
APIs drive innovation.
APIs have been a fundamental building block of computing since the 1940s, as no useful software system can work entirely on its own. APIs enable developers to build new software that uses existing code without having to learn the intricacies of the original system.
The abundance of useful APIs online allows developers to rapidly build new software that leverages everything that has come before it. And if you offer API access to your unique business functions, it means new, popular systems can be built with your company’s services powering them all, ultimately becoming a new source of revenue.
How much does an API cost?
Most APIs are free to use. Computer programs use APIs all the time. The Windows API is used by programs to interact with the OS’s systems, like the user interface, data storage, and networking, for example. Games use graphics APIs like Vulkan, DirectX, and OpenGL to perform complex operations on your computer’s graphical processing unit without needing to know exactly how the operations will be performed on each and every piece of hardware.
Some businesses charge based on the number of calls you make to an API or offer tiered pricing. For example, Amazon Comprehend has nine APIs for natural language processing, which are free for the first five million characters but cost $0.0005 per 100 characters after that.
The more complex processing an API call entails, the more likely it is to cost more. If a company needs to use significant resources to process your API requests, expect them to be expensive.
API frequently asked questions
What are the three main types of API?
As APIs are used in just about every facet of computing, there are a few API types you probably make use of daily, knowingly or otherwise. Almost all APIs will fall into one of these categories.
An interface to a software library is a type of API. There are thousands of reusable software libraries out there that coders use, and the API specification outlines how programmers can make use of the library without having to learn every line of the code.
Remote APIs are set standards for how remote resources can work together. For example, there are hundreds of databases that offer the Java remote method invocation API as an interface. It doesn’t matter how the database is implemented underneath; programmers can use the same API methods they know and love to connect to all of them because they share a common API.
Web APIs offer remote access to a system through calls to a website uniform resource identifier (URI). Typically, structured messages between systems are sent in XML format. Web APIs have become the norm for businesses offering API services over the internet.
What is REST?
REST (representational state transfer) is a software architectural style that defines how some remotely distributed systems should operate on the internet. It’s a widely accepted set of guidelines for how web APIs should be written.
REST isn’t the only communication standard in use today. These are also examples like SOAP, XML-RPC, and CORBA that all have their advantages and disadvantages. But REST is relatively simple and is used by everyone from Facebook to Netflix to define the overall format of basic web APIs.
Any web API that follows REST conventions is known as RESTful.
What does a REST API call look like?
A REST API call will look something like this example:
This example API call might return an XML document listing all products between 500 and 800 dollars that are relevant to user 123. The developer must read the API documentation to understand what each sent variable represents and what the returned XML document will include.
Let’s summarize the most important information on APIs.
- An API is a set of functions that enable interaction with and between software.
- APIs act as a bridge between multiple software systems.
- Using APIs, you can automate software tasks and leverage existing systems.
- Many modern APIs are web APIs that work over the internet using HTTP and XML.
- If you offer limited API access to your business functions, innovative and profitable new products can be made.
More on APIs and how they can benefit your business
Read more about how best to implement an API and how API-driven data automation is the secret weapon for digital transformation. We also offer 5 tips for building an API that your clients can connect to and bust many of the common API myths.
But when you open up your software with a public API, security is paramount. Read about how almost all businesses suffer from API-related security issues and why API security can’t be ignored.