Some projects require not only the implementation of the client side, such as a web site, a mobile application, with which users will explicitly interact, but also a special program interface of the application, API.
If your product involves a website, a mobile application, and the ability to integrate into other products, you will most likely need an API.
Usually, this is a set of routes on which the most frequently used logic of your application is tied, such as registering users, getting a list of products / orders, placing an order, etc., much depends on the project. By creating it,you give developers the potential to create application interfaces without limiting themselves due to the formation of the client-side server.
OAuth 2.0 authorization
Real-time data exchange
Single logic, different interface
Usually, the server willreturn data in one of the most commonly used formats as a response: JSON or XML. This allows you to optimize data exchange with the server and the speed of your application, because ready data for the client part is returned sooner than much more heavy HTML pages.
To create multi-user mobile applications, writing an API is imperative, since with the help of it, the mobile application will interact with the server, save, receive data, etc.