NightDev Community Forums

javascript command not working

here is the command I am trying:
$(eval var api = $(urlfetch json https://rest-sandbox.coinapi.io/v1/COINBASE_SPOT_ETH_USD/current?apikey=x); var obj = JSON.parse(api); obj.bid_price; )

It is supposed to return the price of ETH, and it does get data from the API call but it doesnt parse it, it just returns “unknown identifier”…this code works elsewhere just not in Nightbot, what am I doing wrong?

Hiya, you sure the url is correct, would expect something after /v1/?
Can’t really test it out without an API key, but dont see this endpoint in their docs.