What Is an API? How Different Apps Exchange Data

  • An utility programming interface (API) is software program that acts as an middleman between two applications. 
  • APIs make it simple for apps to alternate info, information, footage, and extra.
  • APIs additionally let apps have extra options, since one program can simply ask one other program to carry out a job.
  • Go to Insider’s Tech Reference library for extra tales.

An API, or utility programming interface, is software program that acts as an middleman between two different applications — or two elements inside a program — to alternate info. APIs are widespread sorts of pc code and kind the muse of our fashionable info structure. 

What to find out about APIs

APIs encompass two elements, and each are routinely known as “the API,” which might be complicated:

  • The technical specification that defines the small print of what info is being exchanged between two applications, and the formal protocol for the way that might be achieved.
  • The software program itself that serves because the middleman between two applications.

APIs exist primarily to simplify the method of making and sustaining software program, along with extending and enhancing a program’s capabilities.

Think about a program like a phrase processor, for instance. Within the earliest days of PCs, if a phrase processor like Microsoft Phrase wanted to print a doc, the builders needed to embody code that allowed the software program to speak with each printer a consumer may presumably personal.

Home windows solved that drawback by providing a library of printer drivers constructed into the working system; every driver solely wanted to be written as soon as, and applications merely use the printer API to entry any printer. 

software developer analyzing data on laptop tablet desktop

The introduction of APIs helped streamline software program growth.

Cavan Photos/Getty Photos

That is additionally an instance of how APIs provide a layer of abstraction. The phrase processor would not must know how to print to a selected printer; it merely sends a print request to the printer API, and the API handles the how of printing.

API specs

As a result of APIs are the glue that binds totally different applications collectively, they should observe normal protocols in order that any builders who use the API perceive easy methods to combine it into their code. There are a handful of widespread specs in use immediately.

Every certainly one of these is a special solution to standardize the best way information is exchanged between applications, which is necessary since an API ought to be capable of work no matter how this system is written and even what language is used to code it.

These are the commonest protocols used to develop API specs immediately:

  • Distant Process Name (RPC)
  • Service Object Entry Protocol (SOAP)
  • Representational State Switch (REST)
  • GraphQL

APIs in the true world

APIs are a core part of most fashionable software program, so we’re surrounded by them. Listed below are a couple of examples of APIs in widespread use:

  • Fb makes its social graph and advertising information obtainable to third-party builders by way of its pair of Graph and Advertising and marketing APIs. The Graph API lets applications learn and write to the Fb social graph with entry to pages, customers, posts, and extra. Likewise, the Advertising and marketing API offers entry to Fb advert campaigns, customized audiences, and studies.

Facebook for Developers API page

Builders can use Fb’s APIs for a wide range of functions.

Grace Eliza Goodwin/Insider

  • Google maintains dozens of public APIs that enable builders of third-party purposes and net providers to entry Google providers. You possibly can see a listing of them at Google’s API Explorer. 

Google API Explorer page

you’ll be able to view Google’s public APIs on its API Explorer website.

Grace Eliza Goodwin/Insider

  • Twitter provides a web-based Twitter API that lets builders create tweets, seek for printed tweets, and even favourite tweets programmatically. 

Twitter API homepage

Twitter’s API helps builders automate processes like favoriting tweets.

Grace Eliza Goodwin/Insider