Skip to main content

Solana API

Query Solana wallet balances and token holdings, fetch live SOL market data, and save per-user RPC endpoint configurations.

Get SOL price

GET /api/solana/price
Returns the current SOL price in USD along with 24-hour market data. Data is sourced from CoinGecko and cached for 60 seconds.

Response

{
  "price": 148.52,
  "change24h": -2.34,
  "marketCap": 72500000000,
  "volume24h": 3200000000
}

Response fields

FieldTypeDescription
pricenumber | nullCurrent SOL price in USD
change24hnumber | null24-hour price change percentage
marketCapnumber | nullMarket capitalization in USD
volume24hnumber | null24-hour trading volume in USD
Fields return null when CoinGecko does not include them in the response. Price data is cached and refreshed every 60 seconds.

Errors

CodeDescription
500Failed to fetch price data from CoinGecko

Look up wallet

GET /api/solana/wallet
Returns the SOL balance, token holdings, and account metadata for a Solana address. You can optionally specify a custom RPC endpoint.

Query parameters

ParameterTypeRequiredDescription
addressstringYesSolana wallet address (base58-encoded, 32–44 characters). Invalid addresses return a 400 error.
rpcstringNoCustom Solana JSON-RPC endpoint URL. Defaults to https://api.mainnet-beta.solana.com.

Response

{
  "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "solBalance": 1.5,
  "tokens": [
    {
      "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "symbol": "USDC",
      "amount": 250.0,
      "decimals": 6
    },
    {
      "mint": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
      "symbol": "JUP",
      "amount": 100.0,
      "decimals": 6
    }
  ],
  "accountInfo": {
    "isExecutable": false,
    "owner": "11111111111111111111111111111111",
    "rentEpoch": 18446744073709551615
  }
}

Response fields

FieldTypeDescription
addressstringThe queried wallet address
solBalancenumberNative SOL balance (in SOL, not lamports)
tokensarraySPL token holdings with a non-zero balance, sorted by amount descending (max 20)
tokens[].mintstringToken mint address
tokens[].symbolstringToken symbol. Known tokens display their ticker (e.g. USDC, JUP); unknown tokens show a truncated mint address.
tokens[].amountnumberToken balance in human-readable units
tokens[].decimalsnumberToken decimal precision
accountInfoobjectOn-chain account metadata
accountInfo.isExecutablebooleanWhether the account contains an executable program
accountInfo.ownerstring | nullProgram that owns this account
accountInfo.rentEpochnumber | nullEpoch at which rent was last collected

Recognized tokens

The following token mints are resolved to human-readable symbols automatically:
SymbolMint addressDecimals
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v6
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB6
WSOLSo111111111111111111111111111111111111111129
JUPJUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN6
BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB2635
WIFEKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm6
mSOLmSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So9
stSOL7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj9
Tokens not in this list display a truncated mint address as the symbol.

Errors

CodeDescription
400Invalid Solana address. The address must be a base58-encoded string between 32 and 44 characters.
500Failed to fetch wallet data from the Solana RPC endpoint

Get RPC configuration

GET /api/solana/rpc-config
Returns the custom Solana RPC URL saved for the authenticated user. Requires session authentication.

Response

{
  "rpcUrl": "https://my-custom-rpc.example.com"
}

Response fields

FieldTypeDescription
rpcUrlstringThe saved custom RPC URL. Returns an empty string if no custom URL is configured.

Errors

CodeDescription
401Unauthorized — no valid session

Save RPC configuration

POST /api/solana/rpc-config
Saves or updates the custom Solana RPC URL for the authenticated user. Only HTTPS URLs are accepted. Requires session authentication.

Request body

FieldTypeRequiredDescription
rpcUrlstringYesA valid HTTPS URL for the custom Solana RPC endpoint

Example request

{
  "rpcUrl": "https://my-custom-rpc.example.com"
}

Response

{
  "success": true,
  "rpcUrl": "https://my-custom-rpc.example.com"
}

Errors

CodeDescription
400Missing rpcUrl, value is not a string, URL is invalid, or URL does not use HTTPS
401Unauthorized — no valid session