Created
September 15, 2019 22:29
-
-
Save clecidor/903c699878f41ec0b725cc78743bb644 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
fetch('https://backend.otcmarkets.com/otcapi/market-data/active/current?page=1&pageSize=1000').then((res) => res.json()).then(({ records }) => { | |
const keys = [ 'symbol', 'item', 'itemDesc', 'tierId', 'tierName', 'tierCode', 'price', 'tradeCount', 'dollarVolume', 'shareVolume' ].join(','); | |
const values = records.map(r => [ r.symbol, r.item, r.itemDesc, r.tierId, r.tierName, r.tierCode, r.price, r.tradeCount, r.dollarVolume, r.shareVolume ].join(',')); | |
console.log([].concat(keys, values).join("\n")); | |
}).catch(console.log) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment