Register now or log in to join your professional community.
for eg User Interface for providing two numbers and then getting the result, it should be called a web application. But if you have an API exposed to receive two numbers and return result over http , then it should be called a web service.
Web Services - that's standard defined by W3C, so they can be accessed semi-automatically or automatically (WSDL / UDDI). The whole thing is based on XML, so anyone can call it.
Web API is typically done as HTTP/REST, nothing is defined, output can be eg. JSON/XML, input can be XML/JSON/or plain data.
A web service allows for machine to machine communications over HTTP. A web API is a subset of web services that use REST conventions for its communications.
As you can see, the answer is not easy and it is difficult to shape. Maybe i can help you to develop an understanding.
API is an acronym for Application Programming interface. In general it is an interface you can use to make use of public (or otherwise accessible) functionalities.
It often involves a mapping of function (e.g. getAddressOfUser) to an HTTP request (e.g. http://www.example.com/address). These are becoming increasingly popular, because of the standardized use across the web.
You can give access to functionalities via an API or make use of available API for your own application.
JavaScript is a particular case. It is also a Web API, a programming interface developers can use to develop web sites. The Mozilla Development Network refers to it as such in their documentation.
In general any API that can be used in the web can be named Web API.
A popular notation to exchange data is JSON (JavaScript Object Notation) on most Web APIs. JSON is not a standard defined by the W3C, yet very popular.
In a classical sense a web service was considered to be an accessible functionality (be it public or restricted), in which XML is used to exchange data and format. All information is in the XML.
You can achieve the same as with a Web API, because at the bottom line these are function calls and return values.
Nowadays the naming Web API or Web Service is getting blurred. So you can use the terms interchangeably in many cases. They serve the same purpose: Call a function, data processing, get a response.
Note:
None of the two is specifically made for a particular communication channel. Web APIs and Web Services can be used for all sorts of communication where there is a sender and a receiver.
Web API(Application Programming Interface) is one single file in which all piece of codes put together. API doesn't require to be online.
Web service is a collection of APIs working together to perform a task. Web service can be accessed using transport protocol (HTTP).
With the help of web application interface user interact with database or system . If we define the interface as a client then registered as web page > if user request for the function then it called web service provide by the web server
API: application programmer interface which means it;s open to public and anyone who wishes to integrate with your site can reuse it, a sample is facebook open graph .
A web service, is a component of your site that acts as a service, which means it can be reused internally as well, this follows the concept of Software as a service