API (Application Programming Interface)
What is an API?
An API is a set of rules and protocols that allows different software applications to communicate with each other. It defines how requests and responses should be formatted, enabling developers to use the functionalities of a service or application without needing to understand its inner workings.
Two or more application interact and communicate with each other with API.
Real life example, if we’re using a weather app on our phone, that app might use an API to get weather data from a server. We ask for the weather, the app sends that request through the API, and the API fetches the data from the server and brings it back to our app.
Get D-Adda’s stories in your inbox
Join Medium for free to get updates from this writer.
─── ⋆⋅☆⋅⋆ ───── ⋆⋅☆⋅⋆ ───── ⋆⋅☆⋅⋆ ───── ⋆⋅☆⋅⋆ ───── ⋆⋅☆⋅⋆ ──
/) /) ~ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
( •-• ) ~ Let’s break down it with Restaurant Scenario:-
/づづ ~ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛Customer (User): You, the person wanting to eat.
Menu (API Documentation): The list of available dishes and their descriptions. This tells you what you can order.
Waiter (API): The person who takes your order and communicates with the kitchen.
Kitchen (Server): The place where the food is prepared based on your order.
Food (Response): The final dish that the kitchen sends back to you through the waiter.
Process
Browsing the Menu: You look at the menu to see what’s available. This is like reading the API documentation to understand the available endpoints and data types.
Placing the Order: You tell the waiter what you want. In API terms, this is like sending a request to the API, specifying the data you want or the action you want to perform.
Waiter Takes the Order: The waiter takes your order and goes to the kitchen. This is similar to how the API receives your request and forwards it to the server.
Kitchen Prepares the Food: The kitchen prepares your order based on the request. This step is like the server processing your request and performing the necessary actions (like retrieving or modifying data).
Waiter Brings the Food: The waiter returns with your meal. In API terms, this is the response sent back to you, containing the requested data or confirmation that your action was successful.







