Package: py-cryptocoin
This python3 script is based on thecoinmarketcap
APIFor getting coin data you can use the shortcodes for the coins.So you don’t have to use ‘Basic Attention Token’ but ‘bat’ is enough to
get the coin data.LimitsPlease limit requests to no more than 10 per minute.Endpoints update every 5 minutes.Create your own caching mechanism to keep requests to minimumHow do I get set up?Install this script with:pip3 py_cryptocoin –upgrade (or pip py_nsapi –upgrade )ready to use it!Current Coins‘btc’ : ‘Bitcoin’, ‘eth’ : ‘Ethereum’, ‘xrp’ : ‘Ripple’, ‘bch’ :
‘Bitcoin Cash’, ‘ada’ : ‘Cardano’, ‘ltc’ : ‘Litecoin’, ‘xem’ : ‘NEM’,
‘neo’ : ‘NEO’, ‘xlm’ : ‘Stellar’, ‘eos’ : ‘EOS’, ‘miota’ : ‘IOTA’,
‘dash’ : ‘Dash’, ‘xmr’ : ‘Monero’, ‘trx’ : ‘TRON’, ‘btg’ : ‘Bitcoin
Gold’, ‘icx’ : ‘ICON’, ‘qtum’ : ‘Qtum’, ‘etc’ : ‘Ethereum Classic’,
‘lsk’ : ‘Lisk’, ‘xrb’ : ‘RaiBlocks’, ‘ven’ : ‘VeChain’, ‘omg’ :
‘OmiseGO’, ‘usdt’ : ‘Tether’, ‘ppt’ : ‘Populous’, ‘zec’ : ‘Zcash’, ‘xvg’
: ‘Verge’, ‘sc’ : ‘Siacoin’, ‘bnb’ : ‘Binance Coin’, ‘strat’ :
‘Stratis’, ‘bcn’ : ‘Bytecoin’, ‘steem’ : ‘Steem’, ‘ardr’ : ‘Ardor’,
‘snt’ : ‘Status’, ‘mkr’ : ‘Maker’, ‘rep’ : ‘Augur’, ‘bts’ : ‘BitShares’,
‘kcs’ : ‘KuCoin Shares’, ‘waves’ : ‘Waves’, ‘zrx’ : ‘0x’, ‘doge’ :
‘Dogecoin’, ‘etn’ : ‘Electroneum’, ‘veri’ : ‘Veritaseum’, ‘kmd’ :
‘Komodo’, ‘dcr’ : ‘Decred’, ‘drgn’ : ‘Dragonchain’, ‘wtc’ : ‘Walton’,
‘dcn’ : ‘Dentacoin’, ‘lrc’ : ‘Loopring’, ‘ark’ : ‘Ark’, ‘salt’ : ‘SALT’,
‘qash’ : ‘QASH’, ‘dgb’ : ‘DigiByte’, ‘bat’ : ‘Basic Attention Token’,
‘gnt’ : ‘Golem’, ‘hsr’ : ‘Hshare’, ‘knc’ : ‘Kyber Network’, ‘gas’ :
‘Gas’, ‘wax’ : ‘WAX’, ‘ethos’ : ‘Ethos’, ‘pivx’ : ‘PIVX’, ‘gbyte’ :
‘Byteball Bytes’, ‘fun’ : ‘FunFair’, ‘aion’ : ‘Aion’, ‘rhoc’ : ‘RChain’,
‘zcl’ : ‘ZClassic’, ‘fct’ : ‘Factom’, ‘smart’ : ‘SmartCash’, ‘dent’ :
‘Dent’, ‘mona’ : ‘MonaCoin’, ‘elf’ : ‘aelf’, ‘powr’ : ‘Power Ledger’,
‘dgd’ : ‘DigixDAO’, ‘kin’ : ‘Kin’, ‘rdd’ : ‘ReddCoin’, ‘ae’ :
‘Aeternity’, ‘btm’ : ‘Bytom’, ‘nas’ : ‘Nebulas’, ‘sys’ : ‘Syscoin’,
‘req’ : ‘Request Network’, ‘nebl’ : ‘Neblio’, ‘link’ : ‘ChainLink’,
‘eng’ : ‘Enigma’, ‘xp’ : ‘Experience Points’, ‘gxs’ : ‘GXShares’, ‘maid’
: ‘MaidSafeCoin’, ‘sub’ : ‘Substratum’, ‘xzc’ : ‘ZCoin’, ‘nxs’ :
‘Nexus’, ‘nxt’ : ‘Nxt’, ‘med’ : ‘MediBloc’, ‘emc’ : ‘Emercoin’, ‘btx’ :
‘Bitcore’, ‘bnt’ : ‘Bancor’, ‘cnd’ : ‘Cindicator’, ‘qsp’ : ‘Quantstamp’,
‘cnx’ : ‘Cryptonex’, ‘icn’ : ‘Iconomi’, ‘game’ : ‘GameCredits’, ‘pay’ :
‘TenX’, ‘part’ : ‘Particl’Global DataThe global data return a Dictionary (DICT) with total market cap and
volume of currenciesParametersOptional parameters: - (string) convert - return 24h volume, and market
cap in terms of another currency. Valid values are: - “AUD”, “BRL”,
“CAD”, “CHF”, “CLP”, “CNY”, “CZK”, “DKK”, “EUR”, “GBP”, “HKD”, “HUF”,
“IDR”, “ILS”, “INR”, “JPY”, “KRW”, “MXN”, “MYR”, “NOK”, “NZD”, “PHP”,
“PKR”, “PLN”, “RUB”, “SEK”, “SGD”, “THB”, “TRY”, “TWD”, “ZAR”Return FieldsYou will get a DICT with the followin fieldstotal_market_cap_usdtotal_24h_volume_usdbitcoin_percentage_of_market_capactive_currenciesactive_assetsactive_marketslast_updatedExample codeimportCryptoCoincc=CryptoCoin()data=cc.getGlobalData()#standard currency (USD)#ordata=cc.getGlobalData('EUR')#to get by currencyprint(data)Coin DataReturns al information about one cryptocoin and the pricingIf you add the convert parameter it will return the cryptocoin price in
that currencyParameters(string) cryptocoin shortcode, see Current Coins above what to useOptional parameters: -(string) currency - return price, 24h volume, and
market cap in terms of another currency. Valid values are: - “AUD”,
“BRL”, “CAD”, “CHF”, “CLP”, “CNY”, “CZK”, “DKK”, “EUR”, “GBP”, “HKD”,
“HUF”, “IDR”, “ILS”, “INR”, “JPY”, “KRW”, “MXN”, “MYR”, “NOK”, “NZD”,
“PHP”, “PKR”, “PLN”, “RUB”, “SEK”, “SGD”, “THB”, “TRY”, “TWD”, “ZAR”Return FieldsYou will get a DICT with the followin fieldsidnamesymbolrankprice_usd [depening on convert / currency]price_btc24h_volume_usd [depening on convert / currency]market_cap_usd [depening on convert / currency]available_supplytotal_supplymax_supplypercent_change_1hpercent_change_24hpercent_change_7dlast_updatedExample codeimportCryptoCoincoin="bat"cc=CryptoCoin()data=cc.(coin)# standard US Dollars#ordata=cc.(coin,"EUR")#get the coin price back in Euro'sprint(data)All Coins DataReturns al information about all current know cryptocoins and the
pricingIf you add the convert parameter it will return the cryptocoin price in
that currencyParametersOptional parameters: - (int) start - return results from rank [start]
and above - (int) limit - return a maximum of [limit] results (default
is 100, use 0 to return all results) - (string) currency - return price,
24h volume, and market cap in terms of another currency. Valid values
are: - “AUD”, “BRL”, “CAD”, “CHF”, “CLP”, “CNY”, “CZK”, “DKK”, “EUR”,
“GBP”, “HKD”, “HUF”, “IDR”, “ILS”, “INR”, “JPY”, “KRW”, “MXN”, “MYR”,
“NOK”, “NZD”, “PHP”, “PKR”, “PLN”, “RUB”, “SEK”, “SGD”, “THB”, “TRY”,
“TWD”, “ZAR”Return FieldsYou will get a DICT with the followin fieldsidnamesymbolrankprice_usd [depening on convert / currency]price_btc24h_volume_usd [depening on convert / currency]market_cap_usd [depening on convert / currency]available_supplytotal_supplymax_supplypercent_change_1hpercent_change_24hpercent_change_7dlast_updatedExample codeimportCryptoCoincc=CryptoCoin()data=cc.getAllCoinData()# Get default data in US Dollarsstart=100limit=10currency="EUR"data=cc.getAllCoinData(start,limit,currrency)print(data)Who do I talk to?Theodorus van der Sluijstheo@vandersluijs.nlLicenseAttribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)You are free to:Share — copy and redistribute the material in any medium or formatAdapt — remix, transform, and build upon the material-The licensor cannot revoke these freedoms as long as you follow the
license terms.-Under the following terms:Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.NonCommercial — You may not use the material for commercial purposes.ShareAlike — If you remix, transform, or build upon the material, you
must distribute your contributions under the same license as the
original.