Most Trusted Cryptocurrency Market Data API CoinMarketCap

updating a .gs to retrieve CoinMarketCap data following their transition to new API

Hi, I have been using the following simple .gs to pull CoinMarketCap prices but it is broken now with their migration to their new API. I believe the issue lies with "function getCoins()" but I'm not sure how to proceed given CoinMarketCap's guide here: https://coinmarketcap.com/api/documentation/v1/#section/Quick-Start-Guide
var queryString = Math.random();
var ss = SpreadsheetApp.getActiveSpreadsheet(); var ssRates = ss.getSheetByName('Rates'); if (ssRates === null) { ssRates = ss.insertSheet('Rates'); }
var targetCurrency = 'usd'
// Grabs all CoinMarketCap data if (typeof targetCurrency == 'undefined' || targetCurrency == '') {targetCurrency = 'usd'}; var coins = getCoins();
function getCryptoData() {
// Use the value in the 'id' field here: https://api.coinmarketcap.com/v1/ticke?limit=0 // If you're getting errors, you may be using the wrong 'id'
var myCoins = [ '0x', 'adelphoi', 'adx-net', 'aeternity', 'aion', 'aigang', 'airswap', 'appcoins', 'aeron', 'aragon', 'ardor', 'ark', 'aurora-dao', 'banyan-network', 'bitclave', 'bancor', 'basic-attention-token', 'binance-coin', 'bitcoin', 'bitcoin-cash', 'bitcoin-god', 'bitcoin-gold', 'bitcoin-interest', 'bitcoin-token', 'bitcoin-private', 'bitcoinx', 'bitcore', 'bitdegree', 'bitsend', 'bitshares', 'block-array', 'blockmason', 'bytecoin-bcn', 'c20', 'canyacoin', 'cardano', 'chatcoin', 'cheesecoin', 'cindicator', 'civic', 'cofound-it', 'counterparty', 'coss', 'cpchain', 'cybermiles', 'dash', 'datum', 'decred', 'digibyte', 'digixdao', 'district0x', 'dogecoin', 'dragonchain', 'edgeless', 'enjin-coin', 'eboostcoin', 'enjin-coin', 'eos', 'eosdac', 'ethereum-classic', 'ethereum', 'ethlend', 'everex', 'factom', 'filecoin', 'funfair', 'gas', 'gnosis-gno', 'golem-network-tokens', 'groestlcoin', 'guppy', 'havven', 'huobi-token', 'icon', 'iconomi', 'ignis', 'invictus-hyperion-fund', 'iostoken', 'iot-chain', 'iota', 'internet-of-people', 'ixledger', 'kucoin-shares', 'kyber-network', 'legolas-exchange', 'library-credit', 'litecoin', 'lightning-bitcoin', 'maker', 'medical-chain', 'mercury', 'metronome', 'monero', 'nano', 'neo', 'newton-coin-project', 'nexus', 'oax', 'omisego', 'omni', 'odyssey', 'origintrail', 'patientory', 'pivx', 'phore', 'polymath-network', 'power-ledger', 'qash', 'qtum', 'quantstamp', 'raiden-network-token', 'ravencoin', 'rchain', 'reddcoin', 'republic-protocol', 'rialto', 'ripio-credit-network', 'ripple', 'rise', 'rlc', 'salt', 'semux', 'siacoin', 'singulardtv', 'snovio', 'solaris', 'spreadcoin', 'steem', 'stellar', 'storj', 'stratis', 'streamr-datacoin', 'suncontract', 'syscoin', 'telcoin', 'tenx', 'tezos', 'theta-token', 'time-new-bank', 'tron', 'turtlecoin', 'ubiq', 'ultranote-coin', 'vechain', 'verge', 'veriumreserve', 'vertcoin', 'viacoin', 'vibe', 'viberate', 'vinchain', 'wabi', 'waves', 'wax', 'worldcore', 'zcash', 'zclassic', 'zcoin', 'zencash', ]
ssRates.getRange('A1').setValue("ID"); ssRates.getRange('B1').setValue("Symbol"); ssRates.getRange('C1').setValue("Price USD"); ssRates.getRange('D1').setValue("Price BTC");
var myCoinsObj = {}; var myCoinsCount = myCoins.length; for (var i = 0; i < myCoinsCount; i++) { var c = i+2; var n = 0; while (coins[n]['id'] !== myCoins[i]) { n++; }
myCoinsObj[coins[n]['id']] = coins[n]; ssRates.getRange('A'+(c).toString()).setValue(myCoinsObj[myCoins[i]]['id']); ssRates.getRange('B'+(c).toString()).setValue(myCoinsObj[myCoins[i]]['symbol']); ssRates.getRange('C'+(c).toString()).setValue(myCoinsObj[myCoins[i]]['price_usd']); ssRates.getRange('D'+(c).toString()).setValue(myCoinsObj[myCoins[i]]['price_btc']); 
}
// ================================= // // WALLET BALANCE CONFIGURATION // // =================================
// ===== Wallet Sheet Creator ======================================== // Uncomment the lines of code below // It will create the Wallets sheet for you // If using the Wallets sheet ALWAYS leave it uncommented // ===================================================================
//var ssWallets = activeSpreadsheet.getSheetByName('Wallets'); //if (ssWallets === null) {ssWallets = activeSpreadsheet.insertSheet('Wallets');}
// ===== BCH Wallet Balances ========================================= // Uncomment the lines of code below // Set the variable by pasting your Address inside of the ("") // Change getRange('A1') and getRange('B1') to match the row you want // ===================================================================
//var bchWallet = getBchBalance("Your BCH Address"); //ssWallets.getRange('A1').setValue("BCH Wallet"); //ssWallets.getRange('B1').setValue(bchWallet);
// ===== BTC Wallet Balances ========================================= // Uncomment the lines of code below // Set the variable by pasting your Address inside of the ("") // Change getRange('A2') and getRange('B2') to match the row you want // ===================================================================
//var btcWallet = getBtcBalance("Your BTC Address"); //ssWallets.getRange('A2').setValue("BTC Wallet"); //ssWallets.getRange('B2').setValue(btcWallet);
// ===== Ethereum Wallet Balances ==================================== // Create an account on Etherscan.io // Create an API key at https://etherscan.io/myapikey // Uncomment the lines of code below // Set the API key variable by pasting your API key inside of the ("") // Set the address variable by pasting your Address inside of the ("") // Change getRange('A3') and getRange('B3') to match the row you want // ===================================================================
//var ethApiKey = "Your Etherscan API Key"; //var ethWallet = getEthBalance(ethApiKey,"Your ETH Address"); //ssWallets.getRange('A3').setValue("ETH Wallet"); //ssWallets.getRange('B3').setValue(ethWallet);
// ===== DGB wallet balances ========================================= // Uncomment the lines of code below // Set the variable by pasting your Address inside of the ("") // Change getRange('A4') and getRange('B4') to match the row you want // ===================================================================
//var dgbWallet = getDgbBalance("Your DGB Address"); //ssWallets.getRange('A4').setValue("DGB Wallet"); //ssWallets.getRange('B4').setValue(dgbWallet);
// ===== LTC wallet balances ========================================= // Uncomment the lines of code below // Set the variable by pasting your Address inside of the ("") // Change getRange('A5') and getRange('B5') to match the row you want // ===================================================================
//var ltcWallet = getLtcBalance("Your LTC Address"); //ssWallets.getRange('A5').setValue("LTC Wallet"); //ssWallets.getRange('B5').setValue(ltcWallet);
// ===== VTC wallet balances ========================================= // Uncomment the lines of code below // Set the variable by pasting your Address inside of the ("") // Change getRange('A5') and getRange('B5') to match the row you want // ===================================================================
//var vtcWallet = getVtcBalance("Your VTC Address"); //ssWallets.getRange('A6').setValue("VTC Wallet"); //ssWallets.getRange('B6').setValue(vtcWallet); }
function onOpen() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var menubuttons = [ {name: "clearRates", functionName: "clearRates"},{name: "getCryptoData", functionName: "getCryptoData"}]; ss.addMenu("crypto", menubuttons); }
function clearRates() { var sheet = SpreadsheetApp.getActive().getSheetByName('Rates'); sheet.getRange('A1:D1000').clearContent(); }
function getCoins() {
var url = 'https://api.coinmarketcap.com/v1/ticke?limit=0&convert='+targetCurrency; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var data = JSON.parse(json);
return data; }
function getBchBalance(bchAddress) {
var url = 'https://bitcoincash.blockexplorer.com/api/add'+bchAddress+'/balance'; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var balance = response.getContentText(); //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance * Math.pow(10,-8); }
function getBtcBalance(btcAddress) {
var url = 'https://blockexplorer.com/api/add'+btcAddress+'/balance'; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var balance = response.getContentText(); //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance * Math.pow(10,-8); }
function getEthBalance(ethApiKey,ethAddress) {
var url = 'https://api.etherscan.io/api?module=account&action=balance&address='+ethAddress+'&tag=latest&apikey='+ethApiKey; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var obj = JSON.parse(json); var balance = obj.result; //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance * Math.pow(10,-18); }
function getDgbBalance(dgbAddress) {
var url = 'https://chainz.cryptoid.info/dgb/api.dws?q=getbalance&a='+dgbAddress; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var balance = response.getContentText(); //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance; }
function getLtcBalance(ltcAddress) {
var url = 'https://chainz.cryptoid.info/ltc/api.dws?q=getbalance&a='+ltcAddress; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var balance = response.getContentText(); //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance; }
function getVtcBalance(vtcAddress) {
var url = 'http://explorer.vertcoin.info/ext/getbalance/'+vtcAddress; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var balance = response.getContentText(); //Pause to not trigger API limit for multiple wallets Utilities.sleep(300);
return balance; }
// USE AT YOUR OWN RISK function getRate(currencyId) {
if (typeof targetCurrency !== 'undefined') {conversionRate = 'usd'};
var url = 'https://api.coinmarketcap.com/v1/ticke' + currencyId + '/?convert=' + targetCurrency; var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var data = JSON.parse(json); var obj = parseFloat(data[0]['price_' + targetCurrency]);
return obj; }
function getWebRate(currencyId) { //Example Output: // '=IMPORTXML("https://coinmarketcap.com/currencies/zeeyx?3908288283","//span[@id=\'quote_price\']")';
var coinScrape1 = '=IMPORTXML("https://coinmarketcap.com/currencies/'; var coinScrape2 = '","//span[@id=\'quote_price\']")';
return coinScrape1 + currencyId + '?' + queryString + coinScrape2; }
function getCurrencyConversion(currencyOne, currencyTwo) {
var url = 'https://api.fixer.io/latest?symbols='+currencyOne.toUpperCase()+','+currencyTwo.toUpperCase(); var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var data = JSON.parse(json);
return parseFloat(data['rates'][currencyTwo]); }
submitted by neekolas86 to GoogleAppsScript [link] [comments]

How to stream Binance Websockets data into browser HOWTO: Getting started with Cointrexer XL  Binance Huobi ... Configurable WiFi real time Bitcoin Cash (BCH) ticker. All ... Howto code Binance API price tickers in Google Sheets ... Tutorial: How to Compare All the Coins Listed on Binance Exchange with Python ReX - Demo with BitMEX (APIs ReST JSON Google Sheets Excel) - Binance, Huobi, Kraken and more Node-Red : Binance.com Rest API - Ticker Bitfinex websockets  How to create a cryptocurrency trading bot? - Part 16

Bitcoin Ticker - Tick by tick, real time updates. All data is indicative. Options Last Updated: seconds : Time between graph updates : ms: Play sound on each trade . Round Bids/Asks to 0.500 . Animate Depth Movements . Highlight BTC bids/asks above : Alert if price falls below: Alert if price climbs above: Alert if price change +/- : Sound Alert . Desktop Alert . Show Personalized Content ... Get this ticker imported into excel first. (Keep in mind that it’s not a good idea to link to values in the ticker because as the coin ranks change, so will the row number that they’ll be listed on, which will mess up your links)-To import ticker into excel follow the steps as follows: 1.1. In Excel, under the “Data” tab, click on ... Using the Binance WebSocket for the latest Bitcoin price. The Binance WebSocket requires us to only send a command once to open up a stream, and then data will automatically stream over as prices get updated. import os from binance.client import Client from binance.websockets import BinanceSocketManager from twisted.internet import reactor. We need to import the BinanceSocketManager to use ... However, it would hold much more weight if Binance and other exchanges did so, with the aim of reducing the likelihood of other countries following suit. In section 2.37, there are assurances that the ban would be reviewed if robust evidence emerges. All that said, Binance should also look inwards to what it can do to make it a reputable ... Binance API Telegram Group. For any questions in sudden drop in performance with the API and/or Websockets. For any general questions about the API not covered in the documentation. Binance Developers. For any questions on your code implementation with the API and/or Websockets. Binance Customer Support. For cases such as missing funds, help ... I don't know in this case, I was simply labeling the question that your code doesn't match the actual code that's throwing the traceback, so maybe it saves some other viewer time working it out. Binance Coin $ 27.28 2.02%. Polkadot $ 4.08 1.96%. Litecoin $ 54.72 1.51%. Cardano $ 0.095752 2.39%. Alle Kurse. Tone Vays im Interview: „Ich schließe einen Bitcoin-Kurs unter 3.000 US-Dollar nicht aus“ Startseite; Aktuelle Artikel im Überblick; Insights; Interview; Tone Vays im Interview: „Ich schließe einen Bitcoin-Kurs unter 3.000 US-Dollar nicht aus“ von Dr. Philipp Giese. Am 25 ... Use CoinMarketCap's free crypto API to get the best, most accurate real-time, historical cryptocurrency and exchange trade data for Bitcoin, Ethereum and more The Binance API returns financial data in JSON objects or arrays. Public endpoints include market data, accounts, and user streams. Developers can use the API to create currency exchange applications and services. Binance is bitcoin and cryptocurrency exchange platform. Public Rest API for Binance (2020-04-25) General API Information. The base endpoint is: https://api.binance.com; All endpoints return either a JSON object or array. Data is returned in ascending order. Oldest first, newest last. All time and timestamp related fields are in milliseconds. HTTP Return Codes

[index] [6668] [13219] [20520] [17053] [10043] [5367] [1001] [195] [14703] [18975]

How to stream Binance Websockets data into browser

sheet + script on: https://docs.google.com/spreadsheets/d/11tclKqh5PLQiO-aSbbLwZ9cam4_q7HYHj8DwV86o3k4 Explained and technical background: https://redd.it/8p... In this video, I will show you how to get the historical prices of all the coins listed on Binance exchange in order to compare their risk adjusted returns of the past year, reaching a list of top ... How to use Websockets Stream for Binance Exchange in less than 10 lines of code. - Duration: 11:24. ... Fetch Bitcoin Exchange Data For Beginners Using Websocket - Duration: 20:02. m1xolyd1an ... ReX - Demo with BitMEX (APIs ReST JSON Google Sheets Excel) - Binance, Huobi, Kraken and more Node-Red : Binance.com Rest API - Ticker Danny Lee. Loading... Unsubscribe from Danny Lee? ... NODE RED EXCEL DATA TO JSON RESPONSE IN BROWSER EXCEL READING - Duration: 3:32. Mr Sandeep 7,022 ... Cryptocurrency WiFi ticker. 3D printed, Arduino like MCU based. https://www.etsy.com/shop/CryptoGadgets FEATURES: - Super easy Wi-Fi setup - Choose you favor... https://sites.google.com/site/moosyresearch/projects/cryptos/doc/ctrxl Real-time portfolio view (read-only API keys or Manual) Bibox Binance Binance Jersey B... I will show you how to use Bitfinex websockets to receive live ticker data. This data is required to update technical indicators and find trade opportunities. Bitfinex has rich API. Requests can ...

http://uae-binaryoptiontrade.what-is-forex-trading.club