Documentation Index Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
Use this file to discover all available pages before exploring further.
This guide will help you make your first API calls to the Solana Tracker Data API. You’ll learn how to authenticate, make requests, and handle responses.
Prerequisites
Before you begin, make sure you have:
Solana Tracker Account Sign up for free to get your API key.
Step 1: Get Your API Key
After creating your account, retrieve your API key from the dashboard. This key is used to authenticate your requests by passing it in the x-api-key header.
Navigate to API Keys
Click on the “API Keys” section in the sidebar.
Copy your API key
Click the copy button next to your API key. Keep your API key secure and never commit it to public repositories.
Step 2: Make Your First API Call
Let’s start by fetching the current price of SOL using the /price endpoint.
curl -X GET "https://data.solanatracker.io/price?token=So11111111111111111111111111111111111111112" \
-H "x-api-key: YOUR_API_KEY"
{
"price" : 175.42 ,
"priceQuote" : 175.42 ,
"liquidity" : 14187570.69 ,
"marketCap" : 99213713748.19 ,
"lastUpdated" : 1760274132867
}
Step 3: Connect to RPC Nodes
Solana Tracker also provides RPC nodes for direct blockchain calls. RPC uses a different URL and auth style than the Data API:
Product Use it for Auth style Data API Token prices, wallets, trades, and analytics x-api-key headerRPC Direct Solana methods like balances and account updates api_key in the RPC URL
import { Connection , PublicKey } from '@solana/web3.js' ;
const connection = new Connection (
'https://rpc-mainnet.solanatracker.io?api_key=YOUR_API_KEY' ,
{
commitment: 'confirmed' ,
wsEndpoint: 'wss://rpc-mainnet.solanatracker.io?api_key=YOUR_API_KEY'
}
);
// Get account balance
const publicKey = new PublicKey ( 'YOUR_WALLET_ADDRESS' );
const balance = await connection . getBalance ( publicKey );
console . log ( `Balance: ${ balance / 1e9 } SOL` );
// Subscribe to account changes
connection . onAccountChange (
publicKey ,
( accountInfo ) => {
console . log ( 'Account updated:' , accountInfo );
}
);
Step 4: Explore Common Use Cases
Monitor real-time price changes for any SPL token using the /price endpoint. const apiKey = 'YOUR_API_KEY' ;
const trackPrice = async ( mint ) => {
const response = await fetch (
`https://data.solanatracker.io/price?token= ${ mint } ` ,
{ headers: { 'x-api-key' : apiKey } }
);
const data = await response . json ();
console . log ( `Price: $ ${ data . price } ` );
};
// Track price every 5 seconds
setInterval (() => trackPrice ( 'YOUR_TOKEN_MINT' ), 5000 );
Discover newly created tokens with the /tokens/latest endpoint. It returns the newest tokens first. const apiKey = 'YOUR_API_KEY' ;
const findNewTokens = async () => {
const response = await fetch (
'https://data.solanatracker.io/tokens/latest' ,
{ headers: { 'x-api-key' : apiKey } }
);
const result = await response . json ();
result . data . forEach ( token => {
console . log ( `New token: ${ token . token . symbol } on ${ token . pools [ 0 ]. market } ` );
console . log ( `Liquidity: $ ${ token . pools [ 0 ]. liquidity . usd } ` );
});
};
Track token holdings and the total portfolio value for any wallet. const apiKey = 'YOUR_API_KEY' ;
const getWalletTokens = async ( walletAddress ) => {
const response = await fetch (
`https://data.solanatracker.io/wallet/ ${ walletAddress } ` ,
{ headers: { 'x-api-key' : apiKey } }
);
const portfolio = await response . json ();
console . log ( `Total Portfolio Value: $ ${ portfolio . total } ` );
portfolio . tokens . forEach ( holding => {
const tokenInfo = holding . token ;
console . log ( ` ${ tokenInfo . symbol } : ${ holding . balance } ($ ${ holding . value . toFixed ( 2 ) } )` );
});
};
Error Handling
Always implement proper error handling in your applications.
const apiKey = 'YOUR_API_KEY' ;
try {
const response = await fetch ( 'https://data.solanatracker.io/price?token=INVALID_TOKEN_ADDRESS' , {
headers: { 'x-api-key' : apiKey }
});
if ( ! response . ok ) {
const error = await response . json ();
console . error ( `API Error: ${ error . message || response . statusText } ` );
// Handle specific error codes
switch ( response . status ) {
case 401 :
console . error ( 'Invalid API key' );
break ;
case 429 :
console . error ( 'Rate limit exceeded' );
break ;
case 500 :
console . error ( 'Server error - please retry' );
break ;
}
} else {
const data = await response . json ();
// Process successful response
}
} catch ( error ) {
console . error ( 'Network error:' , error );
}