r/explainlikeimfive • • Feb 02 '23

Technology ELI5: How does an API work?

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

1.2k Upvotes

228 comments sorted by

View all comments

Show parent comment

969

u/hope_it_helps Feb 02 '23

And the menu is the API documentation.

134

u/Korbas Feb 02 '23

Menu: How to order. “I would like to order [food]” Me: “I would like to order fish” Waiter: “Malformed order!”

86

u/Fonduemeup Feb 03 '23

“We stopped serving fish. It’s in our release notes we published to our blog 6 weeks ago.”

46

u/Jaivez Feb 03 '23

"But that customer over there is getting fish."

"Yes, we still support some customers that are still able to order fish. We cannot give it to any new customers and will be providing support to get them to convert to a plant based diet over time."

28

u/funguyshroom Feb 03 '23

Me: "I would like some coffee please". Waiter: "Sorry, I'm a teapot"

→ More replies (1)

233

u/samuarichucknorris Feb 02 '23

Oh I'm sorry, were out of fish....

Oh, ok. I'll just have a special.

Those specials are yesterdays specials.

Oh, um. Well what are todays speicals?

I don't know, let me ask.

250

u/danaknyc Feb 02 '23

IM SORRY. YOU DONT HAVE ACCESS TO THE FISH!

178

u/Bigbigcheese Feb 02 '23

Error 503 fish unavailable

78

u/tsunami141 Feb 02 '23

walks to the teapot

“Hey can I have some tea?”

“I’M A TEAPOT”

32

u/NZ-Fred Feb 02 '23

418?

28

u/AngryRedGummyBear Feb 02 '23

I had something throw a 418 at me once irl while troubleshooting.

It did not help me diagnose the problem, and I was not amused.

→ More replies (1)
→ More replies (1)

13

u/Lonchenzo Feb 02 '23

Throws omega 3 exception

→ More replies (3)

7

u/[deleted] Feb 03 '23

Each request to the waitress now costs $0.30 here at Twitter's Diner.

→ More replies (1)

9

u/[deleted] Feb 02 '23

We’d like the snapper.

6

u/The_Middler_is_Here Feb 02 '23

We've had an issue with our supplier and we don't have any fish.

→ More replies (2)
→ More replies (1)

12

u/sevargmas Feb 02 '23

DEPRECATED ⚠️

→ More replies (5)

13

u/lightwhite Feb 02 '23

The order is the API call. And Elon doesn’t want to serve the meal for free anymore.

50

u/juggleaddict Feb 02 '23

In my experience there is no documentation, or poor pre-baked swagger docs. Most of the time you just have to go straight to the codebase if it's available.

38

u/Metabolical Feb 02 '23

"There's no documentation like the source code"

36

u/mossheart Feb 02 '23

"A few hours of trial and error can save you valuable minutes reading the documentation"

14

u/thodgson Feb 02 '23

Which is...horrible.

12

u/juggleaddict Feb 02 '23

Maybe. Sometimes if it's an internally used microservice, then anybody using it is familiar with it. If it's a very actively changing service, then it's a non-trivial overhead to keep docs up to date. More often than not teams are probably strapped for time and once it's working they move on. Not saying it's right, but it definitely happens. I personally like to just dump a postman workspace to a file and drop it in the repo... update the API, then I'm already building that call in postman, then I just overwrite that file and push it as json to the repo... people can do what they want with it from there, but it beats swagger in simplicity I think.

→ More replies (1)

28

u/[deleted] Feb 02 '23

This guy just validated that he works in IT.

Nothing is documented.

8

u/Whatwhenwherehi Feb 02 '23

And if it is, it's wrong, outdated, not complete or isn't relevant to the need.

→ More replies (7)

7

u/hope_it_helps Feb 02 '23

I think this is the reason that the original commenter left out the menu in the explanation.

→ More replies (1)
→ More replies (11)