Skip to content

Instantly share code, notes, and snippets.

@clecidor
Created September 15, 2019 22:29
Show Gist options
  • Save clecidor/903c699878f41ec0b725cc78743bb644 to your computer and use it in GitHub Desktop.
Save clecidor/903c699878f41ec0b725cc78743bb644 to your computer and use it in GitHub Desktop.
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