Developers
Reading token data
Find tokens and read prices.
Use search to resolve what a user typed into a mint, then fetch that mint for its price. Prefer the verified flag when several tokens share a symbol.
const { data: results } = await privy("/tokens/search?query=bonk&limit=5")
const token = results.find((t) => t.verified) ?? results[0]
const { data } = await privy(`/tokens/${token.mint}`)
console.log(data.symbol, data.usdPrice)