> ## 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.

# Quick Start

> Get up and running with the Solana Tracker Data API in a few minutes — sign up, grab an API key, and make your first token, wallet, and price requests.

<Info>
  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.
</Info>

## Prerequisites

Before you begin, make sure you have:

<Card title="Solana Tracker Account" icon="user" href="https://www.solanatracker.io/account">
  Sign up for free to get your API key.
</Card>

## 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.

<Steps>
  <Step title="Log into your dashboard">
    Visit [your account dashboard](https://www.solanatracker.io/account).
  </Step>

  <Step title="Navigate to API Keys">
    Click on the "API Keys" section in the sidebar.
  </Step>

  <Step title="Copy your API key">
    Click the copy button next to your API key.

    <Warning>
      Keep your API key secure and never commit it to public repositories.
    </Warning>
  </Step>
</Steps>

## Step 2: Make Your First API Call

Let's start by fetching the current price of SOL using the `/price` endpoint.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://data.solanatracker.io/price?token=So11111111111111111111111111111111111111112" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const apiKey = 'YOUR_API_KEY';
  const solMint = 'So11111111111111111111111111111111111111112';

  fetch(`https://data.solanatracker.io/price?token=${solMint}`, {
    headers: {
      'x-api-key': apiKey
    }
  })
  .then(response => response.json())
  .then(data => console.log('SOL Price:', data.price));
  ```

  ```python Python theme={null}
  import requests

  api_key = 'YOUR_API_KEY'
  sol_mint = 'So11111111111111111111111111111111111111112'

  response = requests.get(
      f'https://data.solanatracker.io/price?token={sol_mint}',
      headers={
          'x-api-key': api_key
      }
  )

  data = response.json()
  print(f"SOL Price: ${data['price']}")
  ```
</CodeGroup>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "price": 175.42,
    "priceQuote": 175.42,
    "liquidity": 14187570.69,
    "marketCap": 99213713748.19,
    "lastUpdated": 1760274132867
  }
  ```
</ResponseExample>

## 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` header       |
| RPC      | Direct Solana methods like balances and account updates | `api_key` in the RPC URL |

<CodeGroup>
  ```javascript @solana/web3.js theme={null}
  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);
    }
  );
  ```

  ```python solana.py theme={null}
  from solana.rpc.api import Client
  from solders.pubkey import Pubkey

  # Connect to RPC
  client = Client("https://rpc-mainnet.solanatracker.io?api_key=YOUR_API_KEY")

  # Get account balance
  pubkey = Pubkey.from_string("YOUR_WALLET_ADDRESS")
  response = client.get_balance(pubkey)
  balance = response.value / 1e9
  print(f"Balance: {balance} SOL")

  # Get recent blockhash
  blockhash = client.get_latest_blockhash()
  print(f"Recent blockhash: {blockhash.value.blockhash}")
  ```
</CodeGroup>

## Step 4: Explore Common Use Cases

<AccordionGroup>
  <Accordion title="Track Token Prices" icon="chart-line">
    Monitor real-time price changes for any SPL token using the `/price` endpoint.

    ```javascript theme={null}
    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);
    ```
  </Accordion>

  <Accordion title="Find New Tokens" icon="water">
    Discover newly created tokens with the `/tokens/latest` endpoint. It returns the newest tokens first.

    ```javascript theme={null}
    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}`);
      });
    };
    ```
  </Accordion>

  <Accordion title="Monitor Wallet Holdings" icon="wallet">
    Track token holdings and the total portfolio value for any wallet.

    ```javascript theme={null}
    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)})`);
      });
    };
    ```
  </Accordion>
</AccordionGroup>

## Error Handling

Always implement proper error handling in your applications.

<CodeGroup>
  ```javascript JavaScript theme={null}
  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);
  }
  ```

  ```python Python theme={null}
  import requests
  from time import sleep

  def api_call_with_retry(url, headers, max_retries=3):
      for attempt in range(max_retries):
          try:
              response = requests.get(url, headers=headers)
              
              if response.status_code == 200:
                  return response.json()
              elif response.status_code == 429:
                  # Rate limited - wait and retry
                  print(f"Rate limit exceeded. Retrying in {2 ** attempt}s...")
                  sleep(2 ** attempt)  # Exponential backoff
              elif response.status_code == 401:
                  raise Exception("Invalid API key")
              else:
                  print(f"Error {response.status_code}: {response.text}")
                  break
                  
          except requests.RequestException as e:
              print(f"Network error: {e}")
              if attempt < max_retries - 1:
                  sleep(1)
              else:
                  raise
      
      return None
  ```
</CodeGroup>

<Note>
  **Need help?** Join our [Discord community](https://discord.gg/JH2e9rR9fc) or email [support@solanatracker.io](mailto:support@solanatracker.io).
</Note>
