Difference between API and Web services
An API is an Application Programming Interface, means by which third parties can write code that interfaces with other code.
An api is a collection of class which provide you some functionalities like google api gives you the opportunity to work with the google search.
An application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.
A Web Service is a type of API, almost always one that operates over HTTP (Though some, like SOAP, can use alternate transports, like SMTP). The Official W3C Definition mentions that Web Services don’t necessarily use HTTP, but this is almost always the case and is usually assumed unless otherwise mentioned.
A Web service (also Web Service) is defined by the W3C as “a software system designed to support interoperable machine-to-machine interaction over a network”
Webservices on the otherhand are services available over internet. You can call these services and get so information or functionality in your application without actually having the classes or know how it works.
Hope this information will help someone, Thanks