Created
August 11, 2021 19:04
-
-
Save dannyBuonocore/bb6a39c7cc7f8144022099f8b633da5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run() { | |
var response = UrlFetchApp.fetch('https://api.livecoinwatch.com/coins/single', { | |
'method': 'post', | |
'headers': { | |
'Content-type': 'application/json; charset=UTF-8', | |
'x-api-key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', | |
}, | |
'payload': JSON.stringify({ | |
"currency": 'USD', | |
"code": 'ETH', | |
"meta": true, | |
}), | |
}); | |
var json = JSON.parse(response.getContentText()); | |
SpreadsheetApp.getActiveSheet().getRange('A1').setValue(json.name); | |
SpreadsheetApp.getActiveSheet().getRange('B1').setValue(json.rate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment