What is an API?
API stands for Application Programming Interface.
It is a documented way in which external consumers can understand how they can interact with your code. Or to put it simply it is just a function that external people can call.
It is very similar to a function. We define the parameters, return types and possible errors.
NOTE: External consumers don't need to know how your code works. API is just a contract