Differences of API and Web services?

 API vs Web Service

API- 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.

API is nothing but interface provided to the user for the programming done behind the application. 


Web Service: A Web Service is defined by the W3C as " a software system designed to support interoperable machine to machine interaction over a network"


API and Web Service serve as a means of communication

Web Service facilitates interaction between two machines over a network

API acts as an interface between two different applications so that they can communicate with each other


Introduction of API and Web Service

An api exactly defines the methods for one software program to interact with the other. An api generally involves calling functions from within a software program. 

Being a user you are not bother about program inside of api and only look at the function how to use and it works.

When this action involves sending data over a network, web services come into the picture.

In case of web applications, the API used is web based.

Desktop applications such a spreadsheet and word documents use VBA and COM-based APIs which don't involve web service


A Web Service is merely an API wrapped in HTTP. An Api doesn't always need to be web based. An Api consist of complete set of rules and specifications for a software program to follow in order to facilitate interaction.


The APIs can be exposed in a number of ways which include COM object, DLL and .H files in C/C++ programming languages, JAR files or RMI in Java, XML over HTTP, JSON over HTTP, etc.


Differences

All Web Services are APIs but all APIs are not Web Services.

Web services might not perform all the operations that an API would perform

A Web service uses only three styles of use: SOAP,REST and XML-RPC for communication where as API may use any style for communication.

A Web Service always needs a network for its operation where as an API doesn't need a network for its operation

Web Services are a simple interface using Http Protocol


Web Services can be:

1. Developed by one company

2. Used by another company, and

3. Hosted by a third company


What's in the name Web Services?


Web means HTTP Protocol

Services means request- response

Web Services is a stateless protocol(we send a request, we receive a response, we are finished)




Comments

Popular posts from this blog

Email Sending through O365 using OAuth Protocol

IoT Technology

What is reverse proxy?