How does an API work?

918 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

An API is Application programming interface. Application means it’s a program (in simple), programming that its purpose is to serve for other programs and interface that it allow communication between two different things.

an API is a program that allow other program to communicate with them. In the most common use, it allows any other program you make to call said API, over the internet, and ask for information.

In the case of twitter, to give an example of what it could be: the Api has a function get_last_tweet_from_user(user). Whenever someone call that function they call twitter_api.get_last_tweet_from_user(ArtAndGals) and the api sends back the last tweet from ArtsAndGals. Your program can then do whatever it wants with the information received.

It is of course very simplified, as there are securities, from password to prevent anyone from accessing, to load balancer to ensure someone isn’t sending 10 billions request a second to crash the servers, but that’s the basic principle.

Now, while I do not know what twitter changed nor why the outrage is happening, I can make a few educated guess. The classic issue is that if something that already exist is modified, every single application that used it need to update. For example, our old get_last_tweet_from_user(user) could have been replaced with a new, more global function of get_last_tweet_from(type, value). Type could be user, in which case it works the same way as before, but it could also be tag. The same function now serve to get from either a tag, or a user. While having more option is great, it’s still extra work for everyone involved.

The other possible issue is that they now require stricter security procedure, or even worse, expensive access. No longer can you just call the API for information, you have to also use an account and potentially pay to access it.

Hopefully it helps you understand what an API is and how it works, and maybe to see why it cause trouble to change an API like that.

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