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.
Syntax
| Argument | Description | |
|---|---|---|
url | Required | The 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:
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
Assemble a WEBSERVICE call from a base URL and a search term (encoded automatically).
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
Frequently asked questions
Does WEBSERVICE refresh automatically?
Can I call APIs that need an API key?
Why does it work on my PC but not my colleague's Mac?
WEBSERVICE or Power Query — how do I choose?
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