DEV Community

Discussion on: What **is** an API? 🤷🏼‍♀️ Pt I

Collapse
 
jackalbruit profile image
Jackson Brumbaugh

I was surprised to see APIs compared to contracts. Then my surprise led me to attempt to concoct my own analogy: a librarian.

An API is like a super fast, digital librarian. The librarian oversees all of the library's contents (AKA books in this metaphor). When we, the API user, send a GET request, we a asking that API librarian to "get" us a particular book (i.e. piece of info). I think this analogy even works for PUT | POST | DELETE requests, but in those instances you (the user) are acting more like the library owner instead of a library customer, since you are getting to make decisions about the books that the library keeps in stock.

Collapse
 
javascriptcoff1 profile image
JavaScript➕Coffee🚀

I love this analogy, great job!!!

Collapse
 
jackalbruit profile image
Jackson Brumbaugh

Happy to lend the assist :)