What is the difference between API and Webservice? [closed] - web-services

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
can anybody give me some example?

A web service will expose an API.
Not all APIs are web services - any library will have an API.
APIs are the public interface of a piece of code - it is what you can call from within your code. It may be a web service, but it could also be a JavaScript library, a compiled library for your platform (say .NET assembly, java JAR, a PE DLL and more).

API is more of an abstract concept it is a programatic interface for your application it can be implemented in veraity of methods and technologies. Webservice is a spesific implemenation of such concept that using SOAP and HTTP technologies.

API is an acronym that stands for Application Programming Interface, as such it can be used to describe any piece of software you can use inside another software to develop an application or part of it. As an example the library/module/classes that allow you to open a file and read its contents is an API: you don't know how it works but you can use it into your software to achieve a possible complicate goal.
A web service is usually a remote piece of software capable of responding to web requests which provides some sort of functionality. Usually the word is used to indicate SOAP web services, but a RESTful application is a web service as well. In a broader sense of the word any web site is a web service as they provide a service over the web, but usually we do not consider them in that category because we refer to machine-to-machine interactions.
Now, if you consider that a web service can be used by your application to deliver part of your application logic then a web service IS an API.

They are same thing, Web Service is a specific type of API that is accessed over the web.
Facebook - offers a Web service / API
Twitter - offers a Web service / API
Windows - offers an API
An "Application Programming Interface" was originally used to describe the interface offered by system software(Windows) to be used by application programs (word, Microsoft paint etc...). The term API has since then evolved to encompass pretty much any software interface.
A web service is a software interface that is accessed over the web.
IMO API's that are accessed over the web should only be called Web Services, However the masses have started calling them API's - so that is what it is.
I wrote more about API's here: http://www.woodstitch.com/resources/what-is-an-api.php

Related

Difference between Web Services and Web API [duplicate]

This question already has answers here:
What is the difference between a web API and a web service?
(13 answers)
Closed 6 years ago.
I have already gone through to the couple of tutorials to find the answer of this question but I did not find out the exact one. Everyone discusses about the api which we generally use with our project as a dependency but I always ask this question in context of web only.
What do you think about it?
Is there any difference between these two terms : Web Services and Web API
ya definitely there is difference between both of this frameworks.
In .net web services are built using wcf framework and web api are built using webapi framework.
If you are beginner i would say that web api is nothing but advanced and well developed form of web services.
web api are built as they can serve any type of devices in any format(content-type) of data.
Actually webapi vs web service is such concept that is difficult to explain but very easier to understand by doing some mock labs or experiments.

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?
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.
Web Service (From 0:35)
API (In general) (From 1:12)
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
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.
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.

What is the difference between various web service implementations [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to web services programming. Recently I started learning web services but there I came across various specifications like:
REST
JAX-WS
JAX-RPC
etc.
Kindly update me that does these technologies occur in parallel or some are old versions and others are new versions of the same.
Also do I need to follow a hierarchy while learning these or I could start with any one randomly.
Thanks in advance
rest is a new way of implementing and describing web services via HTTP methods and URIs. Java helps with implementing such web services with jax-rs standard. REST services are often easy to interact with using browser, curl or any HTTP client. See StackOverflow API for an example.
jax-ws is similar to JAX-RS but provides standard way of implementing soap web services (older but also better recognizable in industry). SOAP is much more complex than REST, all messages are sent inside XML envelope, but the protocol is not restricted to HTTP and request-response.
jax-rpc is outdated and currently deprecated:
JAX-RPC 2.0 was renamed JAX-WS 2.0
REST: Representational State Transfer (REST) is a style of software architecture for distributed systems such as the World Wide Web.
http://en.wikipedia.org/wiki/Representational_state_transfer
Java API for XML Web Services (JAX-WS), is a set of APIs for creating web services in XML format (SOAP) mkyong.com/tutorials/jax-ws-tutorials/
JAX-RPC: Java APIs for XML-based Remote Procedure Call (JAX-RPC)
http://www.ibm.com/developerworks/library/ws-jaxrpc1/
As you notice from above descriptions, first one is a architecture and the rest are Jaa APIs.
You may start with REST then based on your requirement choose the API.

How does Instagram use django? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I don't know if this is the right kind of question to ask here or not. I read that Instagram uses django which is a python web framework. But Instagram is an iOS application. Aren't iOS apps written in objective c? What do they mean by Instagram uses django?
IOS is the "Frontend" of the application. Django is a backend "Server Side" Web Framework.
For example, if there is an iPhone application that shows you all the latest tutorial videos about baking (lets say you had a website bakingtutorials.com), you would make an iPhone application in objective-c to run as the frontend. In your objective-c iPhone code, you would communicate with a "server" which runs Django/Python. The Server Side (Django) holds the video and other baking data in a database. The Frontend iOS application requests data from the Django application. Client Side & Server Side communication. This is usually accomplished with a RESTful API - which in basic terms, means the iPhone application uses human-readable URLs to grab data from Django/the server's database. This data is sent to the frontend from the server where it is parsed by objective-c and formatted for the application
Instagram uses it for its website and MAYBE for the API. But there's no official information about that.
And yes, you're right: iOS apps are done in objectiveC
iOS apps can either be natively written in objective-c, or they can be webapps, displaying a mobile service hosted on a site, in a WebKit view.
Regardless of what format Instagram uses for their iOS app, django can still be a solution. As a native app, they can still be communicating from the mobile device to the django web server over a REST api interface.
Django does not have to be used exclusively to serve HTML. It can serve any kind of HTTP response you want. This is very common for sites when they have a desktop browser interface, and then also expose some API urls to the same backend, allowing mobile apps to make the same requests.

what is API web services, how do you create them and why? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
what is the purpose of web services?
i mean isn't all web applications a web service ?
also why do people create API web services? is it to let developer's use the website's functions? kinda like facebook and youtube ?
is it possible to make a API for web service where you can use C++ or VB to use the functions? therefore, someone could make a desktop application based on your web application's API ?
how do you create a web service API and a web service ?
what is the purpose of web services?
Allow the easy consumption of a service using web technologies? I mean, you can potentially code your application to do what the browser does ( that's how many applications for stackoverflow have been done in the past )
The problems are:
it is much harder than using an API
Since there is no API, changes in the website do crash your application ( while responsible API's will allow you to use your old version )
i mean isn't all web applications a web service ?
Not at all. A web app is an specific application designed to be used by a webbrowser ( firefox, chrome, etc ) While a webservice is meant to be consumed by other application.
You can consume a webservice in pretty much any programming language out there.
also why do people create API web services? is it to let developer's use the website's functions? kinda like facebook and youtube ?
Not the website functionality but to allow them to create own applications that use some functionality of that website.
For instance YouTube allow you to upload videos with it's API, otherwise you'll have to "simultate" the HTTP post which can be problematic.
That way, some tools offer the capability of "uploading" your video directly from the app.
is it possible to make a API for web service where you can use C++ or VB to use the functions?
That's the point, among other programming languages.
therefore, someone could make a desktop application based on your web application's API ?
Exactly!!!
Here's an example of the Object-C application I use for Twitter ( tweetie http://www.atebits.com/tweetie-mac/ )
(source: cachefly.net)
how do you create a web service API and a web service ?*
It is not much different from creating a API for an internal fremework/product/library.
You have to define what are you going to offer ( your public interface, your services that is )
Create a list of in/out parameters and interchange formats ( XML, json, text/plain, YAML, whatever )
And finally provide and endpoint in the web ( or why not intranet )
Webservices could are harder to control than regular APIs, you have to check security concerns, work load etc.
To see a working API refer to that mentioned by Nathan here
There are basically two different types of webservices, one that is SOAP-based and the other is REST-based.
Either can be accessed by desktop applications. I have written applications, such as screensavers, that will interact with the server through both of these types of webservices.
An API is useful so that people can write applications, as you mentioned, to use these services, as, without applications using them, these webservices are pretty useless.
A SOAP-based webservice is basically just a web application that sends and receives using an xml message format that follows a standard.
A REST-based webservice is the cgi-based application that is similar to using an html form element, generally using GET, but, if you are doing anything that can be destructive, or change databases, you will want to use POST.
You can write applications using these APIs in any language, which is the advantage, as you can then choose which language is best for the server-side, and that has no impact on what you do on the client-side.
How to create a webservice will depend on which of the two main types you want to create, and which language you choose to use.
A web service is a type of program running on a web server built especially for other programs to use, by submitting information requests to it in a particular format (usually some information wrapped in XML).
The API part (Application Programming Interface) is usually a class or set of classes that have the code that knows how to format the information to make requests from the Web Service - so that your program only needs to make the usual function calls to the API classes.
It simplifies your use of the web service.
Here is an example of how to make one, and use it for .NET languages: http://www.codeproject.com/KB/XML/BeginnerWebService.aspx
Any program that uses the web for its interface is a web application, like this site or Facebook.
An Application Service Provider is a company that helps you write web apps (http://en.wikipedia.org/wiki/Application_service_provider) or provide other services.
Normally a API is developed to create program that interact with the site, like the Twitter API, that you can use Twitter functions in a program.
If you ever developed applications that rely on libraries or dlls in terms of windows programming. Think of a web service as a dll hosted on a web server that has a direct URL to it.
So your application or website can read the data exposed from the URL that you can use as function calls.
Web services transmits data via xml, once the language you write your application in can read xml, you can write it to make calls to the web service, that is passing parameters and the function name to the service, then if expecting a return value, your application reads the data from xml.