Getting data from object

Hi

I was rolling an online tutorial about making a widget with Scriptable and then try and adapt it for my own requirements.

I’ve got the data from the website using the api but it comes through differently to the tutorial.

This is how I am puling in the data:


let req = new Request(fullurl)

req.method = "GET"

req.headers={
  "Authorization":api,
  "Content-Type":"application/json",
}

response= await req.loadString()
console.log(response)

The console log result is this:


{"results":[{"bounce_rate":100,"source":"Direct / None","visitors":4},{"bounce_rate":0,"source":"domain.co.uk","visitors":1}]}

How do I just list one or maybe even two of them? i.e. results.visitors

1 Like