Let us begin by defining an API.
An API (Application Programming Interface) is a grouping of functions. Functions rules that all services follow. These rules specify which format and command set your application can use to access the service and what data the service can return in the response. Thus, the API serves as a barrier between your application and the external service. You do not need to understand the service's internal structure or features; send a simple command and receive data in a predetermined format.
REST API (Representational state transfer) is a web service communication API that uses HTTP requests.