Home > other >  Import value from JSON in google sheets
Import value from JSON in google sheets

Time:04-15

I'm new to JSON and I found this custom script to import a JSON array in Google Sheets, but now I'm interested to filter out a certain value. How do I do this? I have no idea how to query this.

Example: I'm interested in the Pairs Priceusd value of this URL: enter image description here

CodePudding user response:

Was able to make it work with this:

function DEXPRICE3 (url) {
  var obj = JSON.parse(UrlFetchApp.fetch(url).getContentText())
  return (obj.pairs[0].priceUsd)
}

Thanks for the help!

  • Related