Fetch text data via URL

Hi all,
I have a system I don’t want to chance, that is supplying data on a Webserver as simple Text files, like for example in this screenshot:

I now want to fetch the data (in this example -1625) from this file with scriptable, and then of course save it to a var.
Since I’m not very familiar with JavaScript, I really have no idea how to do it. Further processing the data is no problem because there are a lot of examples in the WWW, but for fetching text data from an URL I wasn’t able to find anything.
Hope you can help me!

After researching nearly the whole day I found the solution, and it‘s much simpler than I thought it would be. Maybe it helps someone else:


let url = "<URL>";
let req = new Request(url);
let result = await req.loadString();

console.log(result);

1 Like