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

When you type an address into a browser, your computer first asks a DNS resolver for the site’s IP — a query that may bounce through your router, your ISP, and one of just 13 root server clusters before the page ever begins to load
Voyager 1 is still transmitting from more than 25 billion kilometres away, powered by less than 250 watts of decaying plutonium — a signal that now takes over 23 hours to reach Earth, carried by a radio no stronger than a refrigerator lightbulb
In September 1947, engineers at Harvard pulled a moth from a relay inside the Mark II computer, taped it into the logbook, and wrote ‘first actual case of bug being found’ — the pest was literal
When Sony shipped the first Walkman in 1979, chairman Akio Morita insisted on a second headphone jack and a “hotline” talk button, convinced it would be rude for one person to listen to music alone — and within a few years buyers had ignored the sociable features so completely that Sony quietly dropped them
Russia still custom-builds the Soyuz return seats for ISS crew members using plaster casts taken weeks before launch, because astronauts grow as much as five centimetres taller during a long-duration stay and a seat moulded to their Earth-shaped spine would no longer fit the body that comes home
The “CrackBerry” nickname stuck for a reason — and the variable-reward psychology that hooked early-2000s executives on their BlackBerrys is the exact same machinery now running every push notification on every smartphone in your pocket
In 1843, Ada Lovelace described a brass-and-punched-card engine that could act on symbols as well as numbers, even composing music if harmony could be reduced to rules, inside seven translator’s notes three times longer than the paper itself
ARPANET sent its first message on 29 October 1969 from a lab at UCLA to a machine at Stanford, and the message was supposed to read ‘LOGIN’ — but the system crashed after the L and the O, meaning the first word ever transmitted over the network that became the internet was, by accident, ‘LO’.