Web APIs and web services are often confused with each other; however, web APIs are an evolution of web services. Both facilitate information transfer, but web APIs are more dynamic than web services are.
By definition, a web service is any piece of software that makes itself available over the Internet and standardizes its communication via XML encoding. In contrast, a typical Web API specifies how software components should interact with each other using the web’s protocol (HTTP) as the go-between. But APIs and web services have things in common – both web APIs and web services serve as a means of communication between consumers and providers. Both support XML-based data payloads, but JSON is the more common payload type for web APIs. In terms of what web APIs and web services have in common, both are essentially a means to an end and the same problems can be solved by both. And both can be configured to operate over a network or within a machine.But the approaches of each come with their own pros and cons.