The general difference between the both is that all web services are APIs, but not all APIs are necessarily web services. Both are used to perform web communications where web services employ only three styles: SOAP, REST, and XML-PRC. Whereas web APIs may use different styles for communication between services based on the requirement.