What is an API?
API stands for ๐๐ฝ๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด ๐๐ป๐๐ฒ๐ฟ๐ณ๐ฎ๐ฐ๐ฒ.
An API (Application Programming Interface) is a set of functions that allows applications to access data and interact with external software components, operating systems, or microservices.
To simplify, an API delivers a user response to a system and sends the systemโs response back to a user. You click "add to cart," an API tells the site you added a product to your cart; the website puts the product in your cart, and your cart is updated.
The API is not the database or even the server, it is the code that governs the access point(s) for the server.
Each time you use an app like Facebook, send an instant message or check the weather on your phone, we are using an API.
In basic terms, APIs allow applications to communicate with one another.
Let's understand this with two ๐ฟ๐ฒ๐ฎ๐น-๐๐ผ๐ฟ๐น๐ฑ ๐ฒ๐ ๐ฎ๐บ๐ฝ๐น๐ฒ ๐
First Example ๐
When we go to the restaurant ๐๐ฒ ๐ผ๐ฟ๐ฑ๐ฒ๐ฟ ๐๐ต๐ฒ ๐ณ๐ผ๐ผ๐ฑ ๐๐ต๐ฟ๐ผ๐๐ด๐ต ๐๐ต๐ฒ ๐๐ฎ๐ถ๐๐ฒ๐ฟ and ๐ฎ๐ณ๐๐ฒ๐ฟ ๐๐ผ๐บ๐ฒ ๐๐ถ๐บ๐ฒ ๐๐ฒ ๐ฟ๐ฒ๐ฐ๐ฒ๐ถ๐๐ฒ ๐๐ต๐ฒ ๐ณ๐ผ๐ผ๐ฑ. ๐๐๐ ๐๐ต๐ฎ๐ ๐ต๐ฎ๐ฝ๐ฝ๐ฒ๐ป๐ ๐ฏ๐ฒ๐๐๐ฒ๐ฒ๐ป ๐ผ๐ฟ๐ฑ๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐ต๐ฒ ๐ณ๐ผ๐ผ๐ฑ ๐ฎ๐ป๐ฑ ๐ฟ๐ฒ๐ฐ๐ฒ๐ถ๐๐ถ๐ป๐ด ๐ถ๐?
๐ฆ๐ผ ๐ต๐ฒ๐ฟ๐ฒ ๐๐ฎ๐ถ๐๐ฒ๐ฟ ๐ฎ๐ฐ๐๐ ๐น๐ถ๐ธ๐ฒ ๐ฎ๐ป ๐๐ฃ๐. ๐๐ฒ ๐๐ฎ๐น๐ธ๐ ๐๐ผ ๐๐ต๐ฒ ๐ฐ๐ผ๐ผ๐ธ ( database or server ) to prepare the food => It means a ๐ฐ๐น๐ถ๐ฒ๐ป๐ ๐ถ๐ ๐ฟ๐ฒ๐พ๐๐ฒ๐๐๐ถ๐ป๐ด ๐ฑ๐ฎ๐๐ฎ ๐ณ๐ฟ๐ผ๐บ ๐๐ต๐ฒ ๐ฑ๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐๐ต๐ฟ๐ผ๐๐ด๐ต ๐ฎ๐ป ๐๐ฃ๐.
Then the ๐ฐ๐ผ๐ผ๐ธ ๐ฝ๐ฟ๐ฒ๐ฝ๐ฎ๐ฟ๐ฒ๐ ๐๐ต๐ฒ ๐ณ๐ผ๐ผ๐ฑ ๐ฎ๐ป๐ฑ ๐ด๐ถ๐๐ฒ๐ ๐ถ๐ ๐๐ผ ๐๐ต๐ฒ ๐๐ฎ๐ถ๐๐ฒ๐ฟ. Finally, the ๐๐ฎ๐ถ๐๐ฒ๐ฟ ๐ฑ๐ฒ๐น๐ถ๐๐ฒ๐ฟ๐ ๐ถ๐ ๐๐ผ ๐๐ผ๐ => It means the ๐๐ฒ๐ฟ๐๐ฒ๐ฟ ๐ฟ๐ฒ๐๐ฝ๐ผ๐ป๐ฑ๐ ๐๐ถ๐๐ต ๐๐ต๐ฒ ๐ฑ๐ฎ๐๐ฎ ๐๐ผ ๐๐ต๐ฒ ๐ฐ๐น๐ถ๐ฒ๐ป๐ ๐๐ต๐ฟ๐ผ๐๐ด๐ต ๐ฎ๐ป ๐๐ฃ๐.
Second Example ๐
๐ ๐ฟ๐ฒ๐ฎ๐น-๐๐ผ๐ฟ๐น๐ฑ ๐ฒ๐ ๐ฎ๐บ๐ฝ๐น๐ฒ ๐ถ๐ ๐ฏ๐๐๐ถ๐ป๐ด ๐บ๐ผ๐๐ถ๐ฒ ๐๐ถ๐ฐ๐ธ๐ฒ๐๐ ๐ผ๐ป๐น๐ถ๐ป๐ฒ. ๐ฌ๐ผ๐ ๐ด๐ผ ๐๐ผ ๐๐ต๐ฒ ๐บ๐ผ๐๐ถ๐ฒ ๐๐ถ๐๐ฒ; ๐๐ผ๐ ๐ฒ๐ป๐๐ฒ๐ฟ ๐๐ผ๐๐ฟ ๐บ๐ผ๐๐ถ๐ฒ, ๐ป๐ฎ๐บ๐ฒ, ๐ฎ๐ป๐ฑ ๐ฐ๐ฟ๐ฒ๐ฑ๐ถ๐ ๐ฐ๐ฎ๐ฟ๐ฑ ๐ถ๐ป๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐ถ๐ผ๐ป, ๐ฎ๐ป๐ฑ ๐น๐ฎ๐๐ฒ๐ฟ ๐๐ผ๐ ๐ฝ๐ฟ๐ถ๐ป๐ ๐ผ๐๐ ๐๐ต๐ฒ ๐๐ถ๐ฐ๐ธ๐ฒ๐๐.
But what happens between entering your information to receiving your ticket? APIs, that's what! They are collaborating behind the scenes with other applications.