JSON Script to import Kucoin API Prices to Google Sheets needs updating

Job ID: 33146952

Budget: $10 – $30 USD

Using google sheets in the past (Haven't used it since the beginning of Covid), I have used this script to import crypto prices from the Kucoin exchange into specific cells:

function Get_KuCoinPrice(market)
{
// example HST-BTC
var url = "https://api.kucoin.com/v1/open/tick?symbol="+market;
var response = UrlFetchApp.fetch(url);
var text = response.getContentText();
var myjson = JSON.parse(text);
var price = myjson.data.lastDealPrice;
return price;
}

To Call the code into my sheet, I use the following"
=Get_KuCoinPrice("BTCUSD")

Now it no longer works.. And I am unable to figure out what changes to the script is needed with the new API code..

The new api url for symbol info is:
https://api.kucoin.com/api/v1/market/orderbook/level1?symbol=

So, when I execute the URL with the symbol:
https://api.kucoin.com/api/v1/market/orderbook/level1?symbol=BTC-USDT

The resulting page is:

{
"code": "200000",
"data": {
"time": 1646712219273,
"sequence": "1626697837569",
"price": "38710.7",
"size": "0.00049864",
"bestBid": "38710.6",
"bestBidSize": "0.00471936",
"bestAsk": "38710.7",
"bestAskSize": "1.30314071"
}
}

So, what I really need is a reconfigured script to pull the "price" into my google sheet with the new api?
Related categories: Web Scraping JSON