Hussain Rauf
Hussain Rauf

Reputation: 298

WEB API's VS WEB SERVICES?

I have searched a lot upon internet but still i didn't get the clear difference between web services and web APIs? Somewhere I read that all web services are API's but all API' are not web services. How?

What all I know is both allow to utilize the functionality of other applications.Can someone describe me clear difference?

Upvotes: 6

Views: 2263

Answers (3)

taz mazia
taz mazia

Reputation: 341

I have been on the same journey to learn the differnce between Web API (not JUST API) vs Web Services.

First, we know for a fact that both use the Web as the communication tool as stated by @Kris.

While looking at these 2 videos, both serve as the "middleman" (the waiter in the restaurant) for a client to ask a Web Server to process and deliver a response.

When I was looking for an actual differnce between the two, usually most articles and videos go on an unrelated comparison between "Web Services vs API" as they exclude the "Web" out of "Web API". See this article, for example, which contains the title "Web API Vs Web Service...." yet, contain sub-titles like:

  • "Differences of API vs Web Service"
  • "Pros and Cons of Web Services vs API Service"
  • "Web Service vs API: Fueling Both With Scraping Robot’s API"

The only difference I could find is if we were to discuss this in .NET context. Here's a question post related to this.

To sum it up, Web Services are used in the SOAP protocal while Web API is usually created in the RESTful way. The more detailed answers are in the post but ultimatelly do not answer the main question that is asked.

Conclusion: The question raised in the public domanin has no clear definition to what is difference between the two, thus the 2 terms are ,for the most part, interchangeable

Upvotes: 6

Kris
Kris

Reputation: 4823

An API (Application Program Interface) is the interface through which another program can communicate with a program.

A web service in this context is one of those programs with an API. 'Web' means that it is accessible via the web, mostly via HTTP. A service usually has a well defined purpose.

For instance a date web service's purpose could be to provide the current date. The API of my service would have a single 'endpoint': get the date. The service then implements this API. It somehow retrieves the date and sends it back.

Upvotes: 1

MiltoxBeyond
MiltoxBeyond

Reputation: 2731

All web services are APIs. An API is an Application Programming Interface. But there are offline APIs, which are not web services. There are APIs for all things from Office to Websites. The API is just a defined interface to be able to control/communicate with some software. Web Services just provide that means of connecting over the web.

There is more to discuss when you are talking about APIs which are communication protocols and data formats, but you get the basic idea.

Upvotes: 2

Related Questions