ID EN
#Web

WEBSERVICE

Excel Functions

Get data from a web service

Syntax

EXCEL
=WEBSERVICE(url)

Arguments

Parameter Description
url The url of the web service to call.

Return Value

Resulting data

Details

The WEBSERVICE function returns data from a web service hosted on the internet. The WEBSERVICE function is only available in Excel 2013 and later for Windows. A web service uses a protocol like HTTP to retrieve data in a machine-readable format like XML or JSON. For example, a formula that uses WEBSERVICE to call a fictitious web service hosted at somewebservice.com might look something like this: The result from the WEBSERVICE function is returned directly to the worksheet. In cases where the result from a webservice is in XML format, you can use the FILTERXML function to parse the XML. A simple example of a web service is RSS, which is used to syndicate content in XML format. RSS is widely available and does not require authentication, so it is an easy way to test the WEBSERVICE function

Examples

Example 1

A web service uses a protocol like HTTP to retrieve data in a machine-readable format like XML or JSON. For example, a formula that uses WEBSERVICE to

EXCEL
=WEBSERVICE(“http://somewebservice.com/endpoint?query=xxxx”)
Example

A simple example of a web service is RSS, which is used to syndicate content in XML format. RSS is widely available and does not require authenticatio

EXCEL
=WEBSERVICE("https://www.nasa.gov/rss/dyn/breaking_news.rss")
Parsing the result

When the result from WEBSERVICE is XML, you can use the FILTERXML function to parse the data. In the example shown, this is how the data and title of

EXCEL
=MID(FILTERXML(B4,"//item/pubDate"),6,11)
Parsing the result

The formula in C7 extracts the title:

EXCEL
=FILTERXML(B4,"//item/title")

See Also

FILTERXML ENCODEURL