Skip to main content
{
  "price": 175.42,
  "priceQuote": 175.42,
  "liquidity": 14187570.69,
  "marketCap": 99213713748.19,
  "lastUpdated": 1760274132867
}
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.
1

Log into your dashboard

2

Navigate to API Keys

Click on the “API Keys” section in the sidebar.
3

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

In addition to the Data API, Solana Tracker provides high-performance RPC nodes for direct blockchain interactions. Note that the RPC endpoint URL and authentication method (passing the API key in the URL path) are different from the Data API.
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 trackPrice = async (mint) => {
  const response = await fetch(
    `https://data.solanatracker.io/price?token=${mint}`,
    { headers: { 'x-api-key': API_KEY } }
  );
  
  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 by using the /search endpoint and sorting by creation time.
const findNewTokens = async () => {
  const response = await fetch(
    'https://data.solanatracker.io/tokens/latest',
    { headers: { 'x-api-key': API_KEY } }
  );
  
  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 getWalletTokens = async (walletAddress) => {
  const response = await fetch(
    `https://data.solanatracker.io/wallet/${walletAddress}`,
    { headers: { 'x-api-key': API_KEY } }
  );
  
  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.
try {
  const response = await fetch('https://data.solanatracker.io/price?token=INVALID_TOKEN_ADDRESS', {
    headers: { 'x-api-key': API_KEY }
  });

  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);
}
Need help? Join our Discord community or email [email protected].
I