Get Pump.fun Token Prices with Moralis API
Easily fetch the latest USD and native prices for any Pump.fun token using the Moralis Solana API. This guide will walk you through everything step by step! π
β¨ What You Can Doβ
Using this API, you can:
- Retrieve real-time token prices (in USD and native SOL)
- Get the best price from the most liquid DEX pair
- Use this data to build trading dashboards, price bots, or DeFi tools
π Step 1: Get Your Moralis API Keyβ
Before making API calls, you need an API key. Hereβs how to get one:
- Go to developers.moralis.com and sign up (itβs free!).
- Navigate to the "API Keys" section in your dashboard.
- Copy your API Key β youβll need this for making requests.
π Step 2: Find Your Pump.fun Token Addressβ
Every Pump.fun token has a unique contract address on Solana. Youβll need this to fetch price data.
- If you already know the tokenβs Solana address, youβre good to go!
- If not, you can find it on Pump.fun or Solana explorers like Solscan.
Example token address for $PUMP token:
9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump
β‘ Step 3: Fetch Token Price via APIβ
Visit the token price API page and make an API request.
You can also use cURL, Postman, or your favorite programming language.
π Example API Requestβ
curl --request GET \
--url 'https://solana-gateway.moralis.io/token/mainnet/9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump/price' \
--header 'accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY'
π Example Responseβ
{
"tokenAddress": "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump",
"pairAddress": "6wJ7W3oHj7ex6MVFp2o26NSof3aey7U8Brs8E371WCXA",
"exchangeName": "Meteora DLMM",
"exchangeAddress": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo",
"nativePrice": {
"value": "4905814",
"symbol": "WSOL",
"name": "Wrapped Solana",
"decimals": 9
},
"usdPrice": 1.178151922
}
π Step 4: Understanding the Responseβ
tokenAddress
: The Pump.fun token contract address.pairAddress
: The liquidity pool pair address.exchangeName
: Name of the decentralized exchange (DEX) providing the price.exchangeAddress
: Address of the DEX.nativePrice
: Price of the token in the native asset (WSOL in this case).usdPrice
: Price of the token in USD.
π Step 5: Integrate into Your Projectβ
Now that you have token price data, you can use it in your app!
π― Some ideas:
- Create a live token price dashboard
- Build a Telegram bot to track prices
- Set up price alerts for Pump.fun tokens
- Embed real-time price widgets in your website