SDK
Token Prices
Learn how to easily fetch token prices through the SDK.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn how to easily fetch token prices through the SDK.
// Fetch the price of a single token
const ethPrice = await sdk.api.usdPrices.getTokenPrice('ETH')
console.log(ethPrice)
// => { token: "ETH", price: 4500, timestamp: '<timestamp>'}
// Fetch the prices of all supported tokens
const allPrices = await sdk.api.usdPrices.getAllPrices()
console.log(allPrices)
// => { ETH: { token: "ETH", price: 4500, timestamp: '<timestamp>' }, ... }