WEBSERVICE Function

Excel Functions › Web

Excel 2013+ Windows desktop only

The Excel WEBSERVICE function fetches data from a URL straight into a cell — a one-formula HTTP GET. Feed the response to FILTERXML and a live API value lands in your worksheet without VBA or add-ins.


Quick answer: pull an API response into a cell:
=WEBSERVICE("https://api.example.com/rates.xml")
Wrap with FILTERXML to extract just the value you need.

Syntax

=WEBSERVICE(url)
ArgumentDescription
urlRequiredThe HTTP/HTTPS address to fetch, as text. Use ENCODEURL for any dynamic values in the query string.

How to use it

The full pattern — dynamic, encoded input and targeted extraction:

=FILTERXML(WEBSERVICE("https://api.example.com/lookup?q=" & ENCODEURL(B2)), "//result")

WEBSERVICE recalculates like other formulas (workbook open, F9), so the cell stays reasonably fresh — but it is NOT a streaming feed.

Windows desktop only: the Web functions (ENCODEURL, FILTERXML, WEBSERVICE) are not available in Excel for the Web, Excel for Mac, or mobile — cells show #NAME? there. For cross-platform data pulls, use Power Query (Data → From Web) instead.

Try it: interactive demo

Live demo

Assemble a WEBSERVICE call from a base URL and a search term (encoded automatically).

Result:

Errors & common pitfalls

#VALUE! — request failed or response too big. Causes: unreachable URL, non-text response (binary), responses over 32,767 characters (the cell text limit), or a blocked/unauthorized request.

No authentication, no headers, GET only. WEBSERVICE can’t send API keys in headers, POST bodies, or handle OAuth. Key-in-URL APIs work; anything fancier needs Power Query or a script.

Pitfall: JSON responses. WEBSERVICE happily fetches JSON text — but FILTERXML can’t parse it. Prefer XML endpoints, or parse crudely with TEXTBEFORE/TEXTAFTER, or use Power Query.

Windows desktop only: the Web functions (ENCODEURL, FILTERXML, WEBSERVICE) are not available in Excel for the Web, Excel for Mac, or mobile — cells show #NAME? there. For cross-platform data pulls, use Power Query (Data → From Web) instead.

Power Query is usually the better tool. These functions predate Power Query; for refreshable, authenticated, multi-row web data, Data → Get Data → From Web wins on every axis. The Web functions remain handy for quick one-cell lookups.

Practice workbook

📊
Download the free WEBSERVICE practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Does WEBSERVICE refresh automatically?
It recalculates when the workbook recalculates (open, F9, dependency changes). It is not volatile and not a live stream — force a refresh with Ctrl+Alt+F9.
Can I call APIs that need an API key?
Only if the key goes in the URL itself (?apikey=...). Header-based auth, OAuth, and POST requests are impossible — that's Power Query territory.
Why does it work on my PC but not my colleague's Mac?
Web functions are Windows-desktop only. Mac, web, and mobile Excel show #NAME?. For shared workbooks, Power Query refreshes work across platforms far better.
WEBSERVICE or Power Query — how do I choose?
One small text value into one cell, quick and dirty: WEBSERVICE. Tables of data, JSON, authentication, scheduled refresh, cross-platform: Power Query, every time.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: ENCODEURL · FILTERXML · WEBSERVICE · TEXTSPLIT · HYPERLINK