I'd like to get a value from https://coinmarketcap.com/ja/api/, but I can't.
There is a problem with 24h_volume_usd starting with a number in the source below. Where should I fix it?
function getCoin24h_volume_usd(currency){
// coinmarketcap API call
var response=UrlFetchApp.fetch("https://api.coinmarketcap.com/v1/ticker/"+currency+"/");
var results = JSON.parse(response.getContentText());
var24h_volume_usd = results[0].24h_volume_usd;
return24h_volume_usd;
}
In many programming languages, including JavaScript, the first letter of the variable name cannot contain a number (can be a second character or later).
For JavaScript
First character: half-width alphanumeric characters, underscores, dollar signs
Second and subsequent characters: half-width alphanumeric characters, underscore, dollar sign
© 2024 OneMinuteCode. All rights reserved.