Last active
February 18, 2021 20:25
-
-
Save alejoasotelo/caa183f89fb5dd83dee823299f0c42e8 to your computer and use it in GitHub Desktop.
get tokens prices by BUSD from coingecko - obteners los precios de tokens en BUSD de coingecko
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
(async () => { | |
let response = await fetch('https://api.coingecko.com/api/v3/exchanges/pancakeswap/tickers?coin_ids=pancakeswap-token,bakerytoken,helmet-insure,bdollar,bdollar-share'); | |
let data = await response.json(); | |
let tickers = json.tickers.filter(ticker => ticker.target == 'BUSD'); | |
let values = tickers.map(ticker => { | |
return ticker.base + '/' + ticker.target + ' = $' + ticker.last; | |
}); | |
values.sort().forEach(value => console.log(value)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment