MTE Explains: What Is an API?

The word “API” is flashed around a lot when talking about new apps and operating systems, but it doesn’t seem to target the general public. There are people out there very excited about new APIs appearing in different platforms, which might make you curious as to what exactly this thing is. There’s no easy way to explain what these things are, but then again, this is what we’re here for!

Defining The API

whatisapi-nexus4apps

An API stands for – Application Programming Interface. But, of course, a quick Google search would have told you that. What you’re here to learn is exactly what an API does.

APIs serve several different purposes, allowing people to add features of their own to applications. You generally hear about them when there’s a new operating system or software. APIs are various functions that give developers the ability to remotely access a web service (or OS) and build a client for the web service. For example, there are many Twitter clients out there. Most, if not all, of them use Twitter APIs to access Twitter and to update/retrieve/delete/reply tweets. The APIs allow the developers to access the Twitter server without any security risk.

API makes your application look uniform to others

If you use one Android app, you’ll notice that it shares some aspects in common with other Android apps. The buttons look similar, and the scroll bar is identical on most of them. That’s because these are API objects provided by Android’s operating system. Without such an API, there would be no uniformity in application items, and they’d also take up a lot more space (I’m talking about several megabytes compared to just three) as the developers need to come up with their own UI code.

The details: How API works

To get down to how an API works in detail, let’s refer back to Twitter clients. When you install a Twitter client, it will first request you to authorize them to access your Twitter account. Once authorized, the client can then access your tweet and allow you to update/reply to tweets. But how does the client communicate with the Twitter server? Instead of writing their own codes, Twitter comes up with a set of rules/functions (API) for the developers to follow. These set of rules make it easy for the client to access your tweet, and they work uniformly throughout all the clients. This also minimizes the chances of bugs, since the API only has to concentrate on that particular task, while the app developers can concentrate on building their apps instead of meddling with never-ending lines of code.

whatisapi-capabilities

So, let’s recap: An API is a list of shortcuts that contain pre-compiled or pre-defined functions and structures that let programmers do their work more easily. It’s either that or a gateway to deeper parts of the operating system you wouldn’t be able to normally reach. For example, video games use APIs that communicate with your graphics card so that they can gain access to its memory and processor. If they communicated with the graphics card directly, each game would have its own way of doing it, leading to very bloated code and much larger games (again, several orders of magnitude larger).

Whenever programmers see new APIs in applications and operating systems, this is why they get excited! Every new API means a new functionality that the developers can integrate into their apps. Every application, every module, and every game you play uses APIs to bring the great features you enjoy using. Even the system running behind a washing machine that communicates with your phone uses APIs to get the job done.

Conclusion

Hopefully this has cleared the waters a little bit, and you understand APIs a little more than before! If you still have questions about APIs, please leave a comment, and I’d be more than happy to help you.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Miguel Leiva-Gomez Avatar

Read next

In November 1988, an unmanned Soviet space shuttle called Buran flew a full orbital mission and landed itself in a blizzard at Baikonur without a single human input, and three years later the country that built it no longer existed.
In 1901, sponge divers off the Greek island of Antikythera pulled a corroded lump of bronze out of a Roman shipwreck, and it sat in an Athens museum for half a century before anyone realised they had found a 2,000-year-old computer that could predict eclipses 19 years in advance.
When Boeing 747-400 pilots needed to update their navigation database as late as 2020, a technician would walk onto the flight deck with eight 3.5-inch floppy disks and feed them one at a time into a slot beside the captain’s seat, because recertifying anything newer than the 1989 avionics would have cost hundreds of millions of dollars.
When the U.S. military finally deployed frequency-hopping spread spectrum on Navy ships during the 1962 Cuban Missile Crisis blockade, the patent that described the technique had expired three years earlier, and its inventor was watching the news in a Los Angeles bungalow without any idea her idea was at sea.
Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
In the small hours of 2 September 1859, a telegraph operator in Portland, Maine disconnected his batteries because they were throwing sparks, and then discovered he could still send a clean message to Boston using nothing but the current the aurora was pushing through the wire above his head.
In 1992, a container ship leaving Hong Kong lost 28,800 plastic bath toys overboard in the North Pacific, and oceanographer Curtis Ebbesmeyer spent the next two decades tracking yellow ducks and blue turtles as they washed up in Alaska, Maine, and eventually the coast of Scotland, quietly rewriting the textbook map of ocean currents.
In 1942, Hollywood actress Hedy Lamarr and avant-garde composer George Antheil received US Patent 2,292,387 for a frequency-hopping radio system synchronised by a perforated paper roll borrowed from a player piano, a technique the Navy filed away as unworkable and which now underpins every Wi-Fi router, Bluetooth earbud, and GPS receiver on Earth.