API stands from Application Programming Interface, and it is a term used in computer science. According to wikipedia’s definition an API is a set of routine definitions, protocols, and tools for building software and applications. Pretty goofy, right?
My preferred approach is to think at API as a tool used for data communication, as a contract provided by one piece of computer software to another. Just think to an API as a set of components (or applications) which interact with each other.
MuleSoft provides a good explanation of an API in the following video:
A non technical explanation of the API is the following: think of the way we are interacting with our TVs. We are doing this through a remote control, which allows us to perform standard operation (power on the TV, change the channels, mute voice, increase volume, etc) on the TV without worrying about the details. We just press a button, while the details behind the scene are controlled by the manufactured of the TV. Well, in that case, that remote control is an API.
APIs are typically categorized by their scope:
- public APIs;
- enterprise APIs.
Why create APIs?
There are many reasons to create APIS.
- for fun;
- allow your clients to build useful applications for them, applications that drive more business to you. For example, a tourism agency builds an API to allow its clients to build custom applications that permit to monitor hot offers.
- your clients demand it.
Characteristics of APIs:
- easy to learn, use and read;
- easy to modify;
- appropriate to the target audience.
Use cases of APIs:
- performing tasks;
- retrieving data;
- manipulating data.
Key take away:
- An API is a contract (a interface) between two or more parties that want to communicate with each other;
- An API is a solution to integrate your application with multiple platforms;
- An API exposes functionality of a specific program (in other words, it allows programatic access to something, for a variety of programming languages);
- allow developers to create an open architecture for sharing functionality and data between applications.