"APIs are how we are going to build software in the future, we are just going to glue it together"
The term API is one of those technical words that most people think they understand, but have a tough time explaining.
I'm going to give you a short primer on:
- What an API is
- Why you need to know it
- What you need to build one yourself
At the simplest level, APIs is an interface to allow applications to communicate with each other.
To go one step further, an API also allows others to share data in a standardized and documented way.
An API is NOT:
- A server
- A database
We can think of an API as an access point to a database.
Example:
Interesting Note: The Facebook - Cambridge Analytica scandal was an example of how a public API could be abused
A good example might be information shared between a company and its customers / partners.
For example, Spotify allows its partners access to its API so that BMW, Ford, Tesla vehicles can natively use Spotify in the built in dashboard systems.
We can log into Uber by using our Google or Facebook login credentials.
APIs allow Uber to request verification of your identity from Facebook. APIs on the Facebook side then confirm to Uber that the person who is signing in is who they say they are.
Alright, hopefully you sort of understand. Seems kind of like a black box, where you request information, and then magically you get a response back.
You don't need to know how that information is obtained, or the code it went through to get it. This is how many developers view APIs -- as a black box.
An analogy for those that are still figuring it out:
Imagine if the electrical sockets in each house on the block were different. Or imagine if the socket configuration changed everytime the power company updated their facilities.
This would make it extremely unpredictable and very difficult to build something that could reliably and consistently use power.
By standardizing and documenting an interface, developers of appliances (TVs, fridges, washer/dryer, etc) can obtain electrical power from any socket.