How does an API work?

960 views

Twitter recently announced they will no longer support free access to the Twitter API. Everyone seems up in arms about it and I can’t figure out what an API even is. What would doing something like this actually affect?

I’ve tried looking up what an API is, but I can’t really wrap my head around it.

Edit: I’ve had so many responses to read through and there’s been a ton of helpful explanations! Much appreciated everyone 🙂 thanks for keeping this doofus in the know

In: 419

41 Answers

Anonymous 0 Comments

My favorite way to explain an API (application programming interface) is to compare it to the much more familiar interface, UI (user interface).

A UI is how an application or piece of software interacts with its human users. It’s all the text, buttons, colors and images that allow you to read and interact with information in the app, and is designed for humans to use.

On the other hand, an API is also an interface, so it also allows ‘something else’ to interact with your application or piece of software, but in this case the ‘something else’ is another piece of software instead of a human.

Some examples include:

* When you use an app on your phone that uses the camera, the app uses an API to ask the phone’s operating system for camera access
* When you go on the weather app, the app sends a request over the network to some server with an API that provides real time data on what the weather is like

For a twitter specific example, if you want to use twitter, you would use a UI (the twitter app or the twitter website), because you’re a human and UI’s are built to be easy for humans to use. But, if you wrote a bot that uses twitter, it would use the API, because its a piece of software and API’s are built to be easy for pieces of software to use.

To sum it all up, humans interact with pieces of software using user interfaces, pieces of software interact with other pieces of software using application programming interfaces.

You are viewing 1 out of 41 answers, click here to view all answers.