Solana's speed and low fees have made it the default chain for DeFi, memecoins, and consumer crypto apps. But if you've tried to build anything that needs real data from Solana (token prices, wallet balances, holder analytics, trading activity), you know the native Solana API layer is harder to work with than it should be. The RPC is low-level, rate-limited, and gives you raw account data that you need to parse and enrich yourself.
This guide covers every approach to getting Solana data as a developer: from raw RPC calls to enriched data APIs to real-time WebSocket feeds. By the end, you'll know which approach fits your use case, where the tradeoffs are, and how to get started with working code.
The Solana Data Landscape
Before diving into code, it helps to understand the four categories of Solana data providers. Each serves a different need, and most production apps end up using more than one.
Solana RPC (native). The foundation. Free public nodes give you raw account data, transaction history, and block information. You do all the parsing, enrichment, and aggregation yourself. No USD prices. No OHLCV charts. No holder analytics.
Solana-specific providers (Helius, Shyft, Triton). Enhanced RPC access with some data enrichment on top. Helius in particular has built a strong Solana-specific platform with their DAS API for compressed NFTs and token metadata. Solana-only: if you expand to other chains later, you'll need a separate provider.
Multi-chain data APIs (Codex, Alchemy, Moralis). Enriched data across multiple blockchains including Solana. Production-ready data: USD pricing, OHLCV charts, holder analytics, aggregated volume.
Market data APIs (CoinGecko, Birdeye). Price feeds and market data. CoinGecko covers CEX and DEX data with broad token coverage but 20-30 second delays. Birdeye is more Solana-focused with a strong UI, though its API access is more limited.
The right choice depends on what you're building. A simple wallet app can get by with RPC. A trading platform needs enriched data with sub-second freshness. A multi-chain portfolio tracker needs a provider that covers more than just Solana.
Solana RPC: The Foundation (and Its Limits)
Every Solana data tool builds on top of the Solana RPC. Understanding what it gives you, and what it doesn't, is essential for choosing the right approach for your project.
What Solana RPC gives you
- Account data: read any account's current state (balances, program data, token accounts)
- Transaction history: fetch raw transactions by signature or for a specific account
- Block data: full block contents including all transactions
- Program logs: parsed instruction data from on-chain programs
- Slot and epoch info: network status and timing
For sending transactions, basic account lookups, or reading program state, RPC is sufficient and free.
What Solana RPC does NOT give you
This is where most developers hit a wall:
- USD prices. RPC has no concept of price. You'd need to find every DEX pool for a token, fetch the pool state, and calculate the price from reserve ratios. For every token. Continuously.
- Token metadata. Names, symbols, images, social links. The RPC gives you raw account data, not human-readable metadata.
- OHLCV charts. No aggregated candle data. You'd need to process every swap transaction and build candles yourself.
- Aggregated volume. No 24h volume, no buy/sell counts, no trader counts. You'd compute all of this from raw transactions.
- Holder analytics. Getting all holders of a token means scanning every token account on Solana. That's not a single RPC call. It's a massive data processing job.
- Real-time enriched feeds. RPC WebSocket gives you raw account updates, not "this token's price just changed to $1.50."
Rate limits on public RPC
Solana's public RPC nodes (api.mainnet-beta.solana.com) are rate-limited and not intended for production use. You'll hit 429 errors quickly under any real workload. Even paid RPC providers throttle requests, and at high volume the cost adds up fast when you're making thousands of calls just to derive a single price.
When RPC alone is enough
- Sending transactions (swaps, transfers, program interactions)
- Reading a specific account's balance or state
- Basic wallet connectivity in a frontend app
- Fetching a known transaction by its signature
When you need something more
- Anything involving USD prices
- Charts, analytics, or aggregated metrics
- Holder data or wallet analytics
- Real-time price feeds or trading activity streams
- Token discovery or search
If your app needs any of the above, you need an enriched data layer on top of RPC.
Getting Solana Token Prices
Token pricing is the most common Solana data need, and the most misunderstood. There are three ways to get a Solana token's price, and they differ wildly in effort and reliability.
Option A: Calculate from RPC (painful)
Fetch the DEX pool accounts for a token, read the reserve balances, calculate the ratio, convert to USD using the SOL price (which you also need to calculate). Repeat for every pool, aggregate across DEXs, handle edge cases for concentrated liquidity pools. Rebuild this every time the pool structure changes. This is fragile, slow, and a maintenance nightmare.
Option B: CoinGecko API (delayed)
CoinGecko provides token prices via REST API. The data is 20-30 seconds old on paid plans, 60 seconds on free. Coverage is limited to tokens CoinGecko has listed. New Solana tokens, especially memecoins, may not be available for hours or days after launch. Rate limits are tight on the free tier (30 calls/min).
Option C: Codex API (real-time)
The Codex API returns real-time USD pricing for any Solana token, including memecoins and newly launched tokens that aren't on centralized exchanges. One query, multiple tokens, sub-second freshness.
Here's how to get prices for SOL, BONK, and JUP in a single request:
import Codex from "@codex-data/sdk";
const sdk = new Codex("YOUR_API_KEY");
const response = await sdk.queries.getTokenPrices({
inputs: [
{
address: "So11111111111111111111111111111111111111112",
networkId: 1399811149,
},
{
address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
networkId: 1399811149,
},
{
address: "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
networkId: 1399811149,
},
],
});
console.log(response);
// Returns: SOL, BONK, and JUP prices in USD. One query, three tokens.
The networkId for Solana is 1399811149. You can query up to 25 tokens per request.
Getting OHLCV chart data
For building charts or running technical analysis, the getBars query returns OHLCV candle data at any resolution from 1-second to 7-day candles:
const bars = await sdk.queries.getBars({
symbol: "So11111111111111111111111111111111111111112:1399811149",
from: Math.floor(Date.now() / 1000) - 86400,
to: Math.floor(Date.now() / 1000),
resolution: "60",
});
// Returns: 24 hourly candles for SOL (resolution "60" = 60-minute candles)
// Each bar: { o, h, l, c, volume, t }
The symbol format is tokenAddress:networkId. Resolution "60" means 60-minute candles; use "1" for 1-minute or "1S" for 1-second candles. You can request up to 1,500 bars per query. This is the same data format TradingView uses, because TradingView uses Codex for their crypto charts.
Solana Wallet and Holder Data
Holder analytics (top holders, total holder count, whale tracking) is another area where raw RPC falls short. Scanning every token account on Solana to build a holder list is a massive infrastructure task.
The Codex holders query gives you ranked holders with wallet addresses, balances, and USD values:
const holderData = await sdk.queries.holders({
input: {
tokenId: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263:1399811149",
limit: 10,
},
});
// Returns:
// {
// count: 654321, // total holder count
// holders: [
// { walletAddress: "...", balanceUsd: 12500.00, ... },
// ...
// ]
// }
The tokenId format is the same address:networkId pattern. You can paginate through all holders using the cursor parameter, and the total count field tells you how many wallets hold the token. This is useful for tracking holder growth, identifying whale wallets, or building holder distribution charts.
Real-Time Solana Data with WebSockets
Solana produces a new block roughly every 400 milliseconds. Things move fast. If you're polling a REST API every 5 seconds, you're missing 12 blocks between each request. For trading bots, price alerts, or live dashboards, polling is not fast enough.
WebSocket subscriptions push data to you the moment something happens on-chain. No wasted requests, no missed events, sub-second latency.
Subscribing to real-time price updates
import Codex from "@codex-data/sdk";
import { gql } from "graphql-tag";
const sdk = new Codex("YOUR_API_KEY");
sdk.subscribe(
gql`
subscription {
onPriceUpdated(
address: "So11111111111111111111111111111111111111112"
networkId: 1399811149
) {
priceUsd
timestamp
address
}
}
`,
{
next: (data) => {
console.log(`SOL price: $${data.data.onPriceUpdated.priceUsd}`);
},
}
);
This opens a persistent WebSocket connection and pushes every price update for SOL in real time. No polling, no wasted requests.
Codex also supports subscriptions for live trade events (onTokenEventsCreated), real-time OHLCV candle updates (onBarsUpdated), and detailed pair stats (onDetailedStatsUpdated). The WebSocket endpoint runs at 99.9% uptime and supports roughly 25 subscriptions per connection. Note that WebSocket subscriptions require a Growth plan. For trading bots, live dashboards, and alert systems, WebSockets are the right choice over REST polling.
For a deeper look at building real-time systems on Solana, see our guide on how to build a crypto trading bot, which covers the full data pipeline architecture.
Solana Launchpad Data (Pump.fun)
Pump.fun is the dominant token launchpad on Solana, with thousands of new tokens launching daily. If you're building a token scanner, sniper bot, or analytics dashboard focused on new Solana tokens, you need Pump.fun data.
Pump.fun doesn't have a public data API. Codex indexes Pump.fun launches directly from the blockchain in real time, including:
- New token launches (address, creator, timestamp)
- Real-time pricing for tokens still on the bonding curve
- Graduation tracking (tokens that migrate to Raydium)
- Trading activity and holder data for any Pump.fun token
Codex also supports 16+ launchpads beyond Pump.fun, including Four.meme, Raydium LaunchLab, Meteora, Clanker, Virtuals, and Zora.
For the full walkthrough with working code examples and WebSocket setup for detecting new launches, see the dedicated Pump.fun API guide.
Comparing Solana Data Providers
Here's how the main options stack up for Solana development:
| Feature | Solana RPC | Helius | Birdeye | Codex |
|---|---|---|---|---|
| USD pricing | No | Limited | Yes | Yes |
| Token coverage | All (raw) | All (raw) | DEX listed | All |
| WebSockets | Yes (raw) | Yes | Yes | Yes (99.9% uptime) |
| Multi-chain | No | No | Some | 80+ chains |
| Enrichment | None | Some | Some | Full (aggregates, holders, charts) |
| OHLCV charts | No | No | Yes | Yes |
| Holder analytics | No | No | Limited | Yes |
| Free tier | Public nodes | 1M credits/day | Free UI | 10K req/mo |
A few notes on this table:
Helius is the strongest Solana-specific provider. Their DAS API for compressed NFTs and token metadata is best-in-class for Solana. If you're building a Solana-only project that primarily needs enhanced RPC access and token metadata, Helius is a solid choice. Where Helius falls short is enriched financial data (USD pricing, OHLCV charts, holder analytics) and multi-chain support.
Birdeye has a strong trading-focused UI and good DEX data for Solana. Their API access is more limited, and they've expanded to some other chains but remain primarily Solana-focused.
Codex covers the enriched data layer: real-time USD pricing, OHLCV charts, holder analytics, aggregated volume and trade metrics, and real-time WebSocket feeds. The multi-chain angle matters if you plan to expand beyond Solana. You get one API for 80+ chains instead of switching providers when you add Ethereum, Base, or Arbitrum support.
For a broader comparison across all crypto data providers, see the best crypto APIs comparison.
Getting Started
The right starting point depends on what you're building:
If you just need Solana infrastructure (RPC, DAS API, token metadata): Helius is strong here. Their free tier gives you 1M credits/day, which is generous for development and early production.
If you need enriched Solana data (prices, charts, holders, real-time feeds): Codex or Birdeye. Codex gives you more data types (holder analytics, aggregated stats, launchpad data) and better programmatic access. Birdeye has a better UI for manual exploration.
If you need Solana + other chains: Codex is the clear choice. Start on Solana, expand to any of 80+ chains without switching APIs or rewriting your data layer. This is the approach TradingView took when they consolidated from 3-4 providers down to one.
Quick start with Codex
Install the SDK and make your first call in under 5 minutes:
npm install @codex-data/sdk
import Codex from "@codex-data/sdk";
const sdk = new Codex("YOUR_API_KEY");
// Get SOL price
const price = await sdk.queries.getTokenPrices({
inputs: [
{
address: "So11111111111111111111111111111111111111112",
networkId: 1399811149,
},
],
});
console.log(price);
Sign up for a free API key at dashboard.codex.io/signup. The free tier includes 10,000 requests per month, enough to build and test any Solana integration. Full API reference is at docs.codex.io.
FAQ
How do I get a Solana token price via API?
Use the getTokenPrices query with the token's contract address and Solana's network ID (1399811149). The Codex API returns real-time USD pricing for any Solana token, including memecoins and newly launched tokens that aren't listed on centralized exchanges. You can query up to 25 tokens in a single request.
What is the best Solana API for developers?
It depends on your use case. For raw Solana infrastructure (RPC, DAS API, compressed NFTs), Helius is the strongest Solana-specific provider. For enriched data across multiple chains (prices, OHLCV charts, holder analytics, real-time WebSocket feeds), Codex provides the most comprehensive data with sub-second freshness. See our full API comparison for a detailed breakdown.
What is the difference between Solana RPC and a data API?
Solana RPC gives you raw, low-level access to the blockchain: account states, raw transactions, block data. You can read any account and send transactions, but you get no USD prices, no aggregated metrics, no charts. A data API like Codex indexes that raw data and enriches it into production-ready formats: USD prices, OHLCV charts, holder analytics, aggregated volume, and more. RPC is like reading raw database files; a data API is like querying a well-structured, indexed database.
Is there a free Solana API?
Solana's public RPC nodes are free but heavily rate-limited and provide raw data only. Codex offers a free tier with 10,000 requests per month that includes enriched Solana data: prices, charts, holders, and token metadata. Helius offers 1M credits/day on their free tier for Solana-specific infrastructure. Both are enough to build and test a Solana application.
How do I get Solana token holders via API?
Use the holders query with the token ID in the format tokenAddress:networkId (for example, DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263:1399811149 for BONK). Codex returns a ranked list of holders with wallet addresses, token balances, USD values, and the total holder count. You can paginate through all holders using the cursor parameter.
Get your free Codex API key at codex.io. 10,000 requests/month on the free tier.

