In software development, a very important concept to know is API which stands for Application Programming Interface. An API is a piece of software that connects 2 different applications. It basically enables one application to talk to another, and thus information is shared between them both.
Let’s use an analogy: imagine you are at a restaurant and you want to order food. Your food request must arrive at the kitchen so that the chefs know what meal they need to prepare. Instead of having to walk to the kitchen to deliver your request and afterwards walking once again to get the meal, what do you do? You call the waiter. The waiter is going to note your order and deliver your request to the chefs. Later, he or she will bring the prepared meal to you and you can finally eat.
An API has the exact same function as that of the waiter in a restaurant. It will receive a request from an application and send it to another software, which will then process that information and usually send some data back to the first application.
Let’s describe a real example to make it more clear: imagine you are willing to book a flight from one city to another. You can check on every aircraft company’s website for the best flight that suits your requirements (not only the city of departure and arrival, but the dates, the seats’ comfort, and so on…). Every single website is going to connect to its database, respectively, in order to search for available flights.
Now, what if you were doing this in a 3rd party app, for example, where the app does not have direct access to the companies’ database? This task would have to be done via the airline’s API, which would carry the request from the user and would return the needed information. In this way, the app does not have direct access to the databases, but it can receive data from them through the use of an API. Therefore, the user does not have to go to the kitchen to get his meal, but the waiter will bring it to him.
But why are APIs so important? Well, we can talk about two major reasons.
First, it is a major time-saver and, therefore, money-saver. If you were developing an app that featured a location tracking system, such as Uber for example, you would have to build everything from scratch (including the maps from all around the globe, calculating the best routes and so on). Using Google Maps’ API for instance, you can skip all of this huge amount of work, since they have already done it. You just need to use it for your purpose.
Second, using an API is a safer way of managing data. Without it, every single customer would have access to the restaurant’s kitchen; they could make a mess with the pans, they could make the floor dirty… That is why the requests must be sent by the waiters.
Some examples of API are listed below: