What is API and ReST API? A simple explanation of API with examples in easy words.

API = Application programming interface
API is a system, that connects web applications or software with data or features of another platform.
In an easy words, in which system we can get data and show it in our application, that is API. [ex: Weather API]
For example,
Suppose, you have a survey company. This company has a lot of data in its database. You can see that, you have some links for data getting, deleting, creating, and updating.
Like these links:

You want to give access to the public without authentication for some survey data from your company’s database. So that, you create a link for that survey data.
Now, Which person needs that data to his web application then he can use the created link. This is API.

ReST API is another type of API.
ReST API — Representational State Transfer Application Programming Interface
REST confirms how will work an API.
Suppose, your web application login system uses a third-party login system. You are using login with Google by Google authentication system.
In this system, your web application has no authentication code and there is no user creation code.

Here A user has to create a Google account [ex: Gmail account] and using this account he can log in to your web application.
What is happening in this system?
Here, at login time your web application verifies the information of the user with the help of Google. If you need details information about the user you can also get them.
This is the ReST API.