Web service is like advanced Urls and API is Programmed Interface. API contains classes and Interfaces just like a program.
A web service is a form of API (Application Programming Interface).
An API is used by a computer programmer to establish a link between software applications. This interface can take several forms, a web service is just one of these.
There are several types of web service. SOAP (Simple Object Access Protocol) is one of the most common.
The API takes the form of a service description (WSDL) which is used to automatically generate the program code which makes the connection.