Many people would often come across the term ‘API’ and would have questioned themselves “What is an API ?? ”. API stands for Application Programming Interface.
Lets first go through the Internet Definition of API. The definition present on wikipedia states that “An application programming interface is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build or use such a connection or interface is called an API specification” .
Like you many people would still find the internet definition confusing and keep asking the same question again & again to know what is really an API ????.
We will understand the API with a simple scenario. It's a Saturday night. And Who does not like Saturday nights !!!?? You planned to have food at your favorite restaurant . And Luckily you got a seat , everything is going on as planned !! Now let's visit through what and all the actions you do at the restaurant.
🔹 You arrive at a restaurant.
🔹 Look at the menu.
🔹 Make a call to the waiter and place the order.
🔹 The chef cooks the food accordingly.
🔹 Waiter serves your ordered food, piping hot right from the kitchen.
In the world of technology, a REST API is like that waiter or waitress.
You are a client requesting food & the Kitchen is the server where your request is fulfilled as the chef would prepare the food for you & the waiter would serve you the food as a response to your request.
Now going back to the definition of API .
API stands for Application Programming Interface. It's a way for different software applications or systems to communicate and exchange information with each other, just like you communicate your order to the kitchen through the waiter.
The API provides a set of rules and commands that define how you can talk to it and what information you can request or send. Just like a menu in a restaurant where all the list of dishes available at the restaurant , the API has a list of available actions (or "endpoints” ) that you can choose from. Each endpoint represents a specific task or operation you can perform.
To interact with the API, you use a programming language or a software application. You send a request to the API, just like you tell the waiter what you want to order. The request includes the specific action or endpoint you want to access, and any additional information the API needs to process your request.
Once the API receives your request, it processes it and sends back a response, similar to how the waiter brings your food from the kitchen. The response contains the information you requested or confirms that the requested action has been completed. It may also include additional details or data that you can use in your own software.
In summary, a REST API is like a waiter or waitress in a restaurant, serving as a bridge between different software applications. It provides a set of rules and commands for communication, allowing applications to request and exchange information with each other. It's a way for different systems to interact and work together seamlessly, just like you interact with a waiter to order food in a restaurant.
Now look at the below image to visualize & get an idea about the whole scenario we went through today !