WEBSERVICE Function in Excel: Read Data From a URL

WEBSERVICE Function in Excel: Read Data From a URL featured illustration

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 28 September 2026

LookupLevel: ExpertAvailable in: Excel 2013+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Common errors and fixes
  5. WEBSERVICE in practice
  6. Where you will use it
  7. Worked example
  8. Mistakes people make
  9. Related functions
  10. Continue learning

WEBSERVICE downloads text from a web address (Windows desktop only). Combined with FILTERXML or TEXTAFTER it can read simple APIs.

Advertisement

Syntax

=WEBSERVICE(url)
Argument What it means
url Up to 2,048 characters, http or https.

Examples

Example 1

=WEBSERVICE("https://api.example.com/rate?from=USD&to=INR")

Returns the raw response text.

Common errors and fixes

You see Why, and the fix
#VALUE! The response is longer than 32,767 characters, or the URL is invalid.

WEBSERVICE in practice

Where you will use it

  • Pull a value from a web API
  • Live exchange rates
  • Check a URL

Worked example

URLFormulaResult
https://example.com=LEN(WEBSERVICE(A2))(changes every recalculation)
https://example.com/=LEN(WEBSERVICE(A3))(changes every recalculation)
https://www.iana.org/robots.txt=LEN(WEBSERVICE(A4))(changes every recalculation)

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Windows onlyNot on Mac or web
Sign-in APIsCan't send headers or keys

FILTERXML Β· ENCODEURL

πŸ“š Part of the free Excel course: Beginner β†’ Expert Β· Try it in the Formula Lab or ask the AI Helper.

⚑ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

πŸ“Ž Practice files for this article

  • πŸ“—
    Practice workbook: Lookup & reference17 tasks on realistic sales data β€” type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX Β· 35 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong