Skip to main content
← All functions

WEBSERVICE function

The WEBSERVICE function returns data from a web service on the Internet or Intranet.

Syntax

WEBSERVICE(url)

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
urlYesThe URL of the web service."https://example.com/api"

Read and use a web response

Calculate from an original saved response, or deliberately request a public HTTPS endpoint. Formula recalculation uses the loaded response and sends no request.

WEBSERVICE returns the response text. It does not select an XML field or turn the whole response into a number. These URLs and responses are original teaching examples; no network request is sent.

Original saved response · 60 UTF-16 units · utf-8

Response source URL: https://example.invalid/report.xml

A2 contains the worksheet URL. Editing it does not send a request; the formula can only use a response loaded for its matching URL.

Inspect the decoded response
<report><region>North</region><amount>18.5</amount></report>
Browser and native compatibility

Microsoft documents WEBSERVICE for Windows Excel; it does not return results on Mac. This browser exercise reads only loaded responses keyed by URL. Live reads require HTTPS and CORS, omit credentials, stop after 15 seconds and accept at most 128 KiB of decoded-transfer bytes and 32,767 UTF-16 units. UTF-8, UTF-16 LE/BE and Windows-1252 are supported. Native Windows authentication, intranet access, redirects, automatic refresh and Excel error/encoding behavior have not been certified here.

Microsoft WEBSERVICE reference ↗

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.