- An application programming interface (API) is software that acts as an intermediary between two programs.
- APIs make it easy for apps to exchange information, data, pictures, and more.
- APIs also let apps have more features, since one program can just ask another program to perform a task.
- Visit Insider’s Tech Reference library for more stories.
An API, or application programming interface, is software that acts as an intermediary between two other programs — or two components within a program — to exchange information. APIs are common types of computer code and form the foundation of our modern information architecture.
What to know about APIs
APIs consist of two components, and both are routinely referred to as “the API,” which can be confusing:
- The technical specification that defines the details of what information is being exchanged between two programs, and the formal protocol for how that will be done.
- The software itself that serves as the intermediary between two programs.
APIs exist primarily to simplify the process of creating and maintaining software, in addition to extending and enhancing a program’s capabilities.
Consider a program like a word processor, for example. In the earliest days of PCs, if a word processor like Microsoft Word needed to print a document, the developers had to include code that allowed the software to communicate with every printer a user might possibly own.
Windows solved that problem by offering a library of printer drivers built into the operating system; each driver only needed to be written once, and programs simply use the printer API to access any printer.
This is also an example of how APIs offer a layer of abstraction. The word processor doesn’t need to know how to print to a particular printer; it simply sends a print request to the printer API, and the API handles the how of printing.
Because APIs are the glue that binds different programs together, they need to follow standard protocols so that any developers who use the API understand how to integrate it into their code. There are a handful of common specifications in use today.
Each one of these is a different way to standardize the way data is exchanged between programs, which is important since an API should be able to work regardless of how the program is written or even what language is used to code it.
These are the most common protocols used to develop API specifications today:
- Remote Procedure Call (RPC)
- Service Object Access Protocol (SOAP)
- Representational State Transfer (REST)
APIs in the real world
APIs are a core component of most modern software, so we are surrounded by them. Here are a few examples of APIs in common use:
- Facebook makes its social graph and marketing data available to third-party developers via its pair of Graph and Marketing APIs. The Graph API lets programs read and write to the Facebook social graph with access to pages, users, posts, and more. Likewise, the Marketing API gives access to Facebook ad campaigns, custom audiences, and reports.
- Google maintains dozens of public APIs that allow developers of third-party applications and web services to access Google services. You can see a list of them at Google’s API Explorer.
- Twitter offers a web-based Twitter API that lets developers create tweets, search for published tweets, and even favorite tweets programmatically.