How does an API work?

930 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

Imagine you come up to a vending machine.

You can do a whole lot with this vending machine. You can:

– Look at the options
– Put a coin in
– Press a button

And the vending machine can respond with:

– Tell you the options
– Tell you how much money you have in
– Dispense a soda if you pressed a button and have enough money

What you **can’t** do is open the vending machine (unless you “logged in” with a vending machine key of course,) or grab the soda from inside, or unplug it. In fact, you don’t even want to. You don’t want the vending machine to give you a run down of every step in the inside mechanical process to give you your soda or how it calculates how much money you have.

Now this is all you need from a vending machine to get your soda.

You can even make a little vending machine grabbing robot which wheels over and puts in the money and gets the soda for you. The robot doesn’t care what’s going on inside the vending machine either.

So in this case, the API is the front of the soda machine – what you can (and can’t) do. Your Apps are like the robot, which wouldn’t be possible if the soda machine was just a blank wall.

*What Twitter wants to do is charge you for even looking at their soda machine.*

So let’s put this into practice, because it’s much worse than it sounds. Let’s say the soda machine now has a guy, let’s call them Big Bird (this is ELI5 after-all,) who’s come on some hard times so was hired by the soda machine company to stand in front of the soda machine, completely blocking it, until you give them a quarter.

If you try to look at the vending machine, they smack you. Quarter first.

Now this soda machine is in a busy spot, the train station near the offices or something, and tons of people come to this exact vending machine to get their soda. It’s part of their routine, right?

Some people will arrive, quickly realize there’s a fee, and then adjust their routine and pay the 25 cents.

But MOST people will look at Big Bird and say… Nope. Not interested in soda anymore. When someone asks them what soda they got they’ll respond with “None.”

Now the real issue is let’s say there’s an elderly person who’s been doing this for decades and they don’t get the new system. They’re going to try to look at the vending machine, get smacked, and break a few bones. More than a few of these will be important people, like, for example, the train station manager, or a news reporter, who because they tried to get a soda are now broken.

As for your robot? They’ll be smacked so fast they’ll be on the curb. And so will everyone else’s robot.

All over the train station there’ll be people and robots on the floor, maybe in a pile of yellow feathers, because the vending machine company wants to eek out an extra 25 cents.

And that’s why it’s a big deal – it’s not only the extra 25 cents, which is greedy in itself and goes against the idea of even making an API, but it’s that thousands of Apps (many of them without the maintenance team or resources for this) will break.

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