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

2

u/augustuen Feb 03 '23

Another important point of APIs is that they provide the data in a machine-friendly way. If you open up the twitter homepage, it'll contain the same information as you'd get from one or a couple of API calls. But it'll also contain lots of other things: ads, styling, buttons and other input stuff, etc.

Tools exist to extract the information from rich webpages like that (they're called scrapers) but the API gives you just the information data. And it does it in a way that's really easy for the machine to process, but harder (though not impossible if you really want to/need to) for humans to process.