Since I’m fond of analogies and metaphors for explanations, here’s the first thing I tell my learner to do when explaining to him/her what an API (Application Programming Interface) is. Watch the first half of this clip from the old game show Who Wants to be a Millionaire, where the contestant uses his “Phone a Friend” lifeline:
What’s “Phone a Friend?” When the contestant gets stuck, he/she can make a single phone call to any friend and ask the question at hand, hoping the friend’s response will be the correct answer (or help lead to the correct answer). Provided the call is made correctly, the question is asked correctly, and the friend is the right person to answer such a question, the response will greatly help the contestant/caller to do something he/she otherwise could not do alone. With that in mind….
What’s an API? It’s when computer code (or an entire program) makes a call to something else to do something it could not otherwise do alone, allowing it to be greater than it is by itself. The call must be made correctly, according to the rules the API specifies, so that the caller can ask correctly and the recipient can understand the request and respond appropriately. And unlike the game show contestants, computer programs aren’t limited to talking with just one API. Programmers/developers often leverage multiple existing APIs to accomplish greater holistic functionality rather than taking the time to develop all the desired functionality themselves. The chances are, most programs you use have been designed to tap some existing API to achieve some part of its functionality.
So, do computer programs do this a lot? You bet. Programs aren’t superheros*; they often just have a lot of friends to call.
* I’ll make an exception for Tron.