Coinbase Institutional CBExchange REST cb exchange public JavaScript example for the Siebly Coinbase SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.
We use environment variables in our examples for API keys. It is your responsibility to manage and secure your keys appropriately.
coinbase-api instead of hand-written HTTP request plumbing.Coinbase/Institutional/CBExchange/Rest/cb-exchange-public.ts.CBExchangeClient.getCurrencies(), getCurrency(), getAllTradingPairs(), getAllProductVolume(), getAllWrappedAssets().import { CBExchangeClient } from 'coinbase-api'; // Initialize the client, you can pass in api keys here if you have them but they are not required for public endpointsconst client = new CBExchangeClient(); async function publicExchangeCalls() { try { // Get all known currencies const currencies = await client.getCurrencies(); console.log('Currencies: ', currencies); // Get a single currency by id const currency = await client.getCurrency('BTC'); console.log('Currency (BTC): ', currency); // Get all known trading pairs const tradingPairs = await client.getAllTradingPairs(); console.log('Trading Pairs: ', tradingPairs); // Get all product volume const productVolume = await client.getAllProductVolume(); console.log('Product Volume: ', productVolume); // Get all wrapped assets const wrappedAssets = await client.getAllWrappedAssets(); console.log('Wrapped Assets: ', wrappedAssets); } catch (e) { console.error('Error: ', e); }} publicExchangeCalls(); We use essential cookies and optional analytics. Read the Privacy Policy.
Essential cookies stay on. Toggle analytics if you want to share anonymous usage insights. You can revisit this anytime via Cookie Settings in the footer.