I want to import json_output_web the value of "p" from the given array in a cell of google sheets. I have never used JS before and I want to get the live price of the respective crypto pair. I used the following code in the Google apps script and received
function myFunction() {
var a = "https://public.coindcx.com/market_data/trade_history?pair=I-BTC_INR&limit=1";
var response = UrlFetchApp.fetch(a);
var jsonresponse = JSON.parse(response);
Logger.log(response)
Logger.log(jsonresponse)
}
var a = "https://public.coindcx.com/market_data/trade_history?pair=I-BTC_INR&limit=1";
var response = UrlFetchApp.fetch(a);
var jsonresponse = JSON.parse(response);
Logger.log(response)
Logger.log(jsonresponse)
Logger.log(jsonresponse.p)
}`
Where am I mistaken?