Skip to main contentSkip to navigation
“Solana H1 2026 Report: Primed for the Third Leap” is out. Read the full report now.
Blog>Developer Guides>How to Build a Powerful Solana TradingView Chart in 4 Steps

How to Build a Powerful Solana TradingView Chart in 4 Steps

The Solana TradingView Chart API guide: resolve tokens, seed up to 5,000 OHLCV candles, backfill on scroll, and keep the live bar fresh with Birdeye Data.

How to Build a Powerful Solana TradingView Chart in 4 Steps

Most Solana charts break at the data layer, not the UI. The candlestick widget renders fine, but candles arrive out of order, history stops loading when the user scrolls back, and the last bar freezes because the live feed quietly dropped. The hard part of a Solana TradingView Chart API integration is the feed, not the chart.

This guide builds the Solana TradingView Chart data layer with Birdeye Data: a multi chain market data service covering real time prices, OHLCV (open, high, low, close, volume) candles, liquidity, and trade activity across Solana and major EVM networks. A Solana TradingView Chart needs four different shapes of data, and the whole pipeline runs on a handful of endpoints. Birdeye even publishes an official TradingView datafeed example at github.com/birdeye-so/tradingview-example-js-api, so the approach below is the same one their reference implementation uses.

The trick is to fetch only what is on screen: stream or poll the visible candle, and pull older history only when the user scrolls back. That keeps credit usage flat as chart traffic grows.

Direct Answer: Build a Solana TradingView Chart in 4 Steps

To build a Solana TradingView chart with Birdeye Data, you need four data layers: resolve, seed, backfill, and live.

Four stage Solana TradingView Chart API pipeline built with Birdeye Data: resolve, seed, backfill, and live candle.
  1. Call GET /defi/v3/search to resolve a symbol or address to a token or pool, and GET /defi/v3/price/stats/single for the toolbar price, high/low, and percentage change.
  2. Call GET /defi/v3/ohlcv to seed the visible viewport with up to 5,000 candles, including second level 1s, 15s, and 30s intervals on Solana.
  3. Page GET /defi/v3/ohlcv by shifting the time window to backfill older candles on scroll, and fall back to GET /defi/history_price for very long line chart ranges.
  4. Keep the last candle live by polling the latest OHLCV candle on an interval (any paid tier) or by streaming SUBSCRIBE_PRICE over WebSocket (Premium package and up). Optionally overlay liquidity with GET /defi/v3/liquidity/ohlc/pair.

All requests share the base URL https://public-api.birdeye.so, authenticate with the X-API-KEY header, and select the network with the x-chain header (default solana). The chart in this guide is Solana, so every header is x-chain: solana.

One access note before you wire up the live layer: REST polling drives the live candle on every tier and is the primary path in this guide. WebSocket streaming is the lower latency option, available from the Premium package up per the Data Accessibility table, which Stage 4 covers in full.

Stage 1: Resolve a Token or Pair with the Search API

Endpoint: GET /defi/v3/search, GET /defi/v3/price/stats/single

Chains: All supported networks

Docs: Token – Search, Price Stats – Single

When a user types BONK or pastes a mint, you need a canonical address before you can request anything else. Search resolves both: it returns token results and market (pool) results in one call, so you can chart either an aggregated token or one specific pool.

Key parameters for search:

ParameterRequiredNotes
keywordNoSymbol, name, or address
chainNosolana (default all)
targetNotoken, market, or all
search_byNosymbol, name, address, combination
search_modeNoexact or fuzzy
sort_byYese.g. volume_24h_usd, liquidity
sort_typeYesdesc or asc
limitNo1 to 20
curl --request GET \
  --url '<https://public-api.birdeye.so/defi/v3/search?chain=solana&keyword=BONK&target=token&search_by=symbol&search_mode=exact&sort_by=volume_24h_usd&sort_type=desc&offset=0&limit=20>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

A common 400: sort_by and sort_type are both required, not optional. Forget either one and the call fails. The response groups results by type, so read data.items[], find the group where type is token, and take result[0].address. Market groups carry the pool address you will pass to the pool level OHLCV and the liquidity overlay later.

For the toolbar, price/stats/single returns price, percentage change, and high/low across one or more windows in a single call. Pass the windows you display as a comma separated list_timeframe.

curl --request GET \
  --url '<https://public-api.birdeye.so/defi/v3/price/stats/single?address=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&list_timeframe=1h,24h>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

One schema gotcha for later: on Solana the stats payload is a direct array under data, while on EVM chains the same endpoint nests results under data.items. If you plan to extend the chart to EVM, branch your parser on chain now.

Now you have a canonical address and toolbar stats for your Solana TradingView Chart. Next, fill the visible chart.

Stage 2: Seed 5,000 Candles with the OHLCV API

Endpoint: GET /defi/v3/ohlcv (token), GET /defi/v3/ohlcv/pair (pool)

Chains: Solana, Base, BSC, Ethereum, Monad

Docs: OHLCV (V3)

The first paint should fill the visible viewport in one request. The V3 OHLCV endpoint returns up to 5,000 records, supports second level Solana intervals, and does not pad missing candles by default, which is exactly what a TradingView datafeed expects from its history call.

Key parameters:

ParameterRequiredNotes
addressYesToken address
typeYes1s,15s,30s,1m,3m,5m,15m,30m,1H,2H,4H,6H,8H,12H,1D,3D,1W,1M
currencyNousd or native
time_fromYesUnix seconds
time_toYesUnix seconds
modeNorange or count
count_limitNo0 to 5,000, used with mode=count
paddingNoDefault false
outlierNoDefault true
curl --request GET \
  --url '<https://public-api.birdeye.so/defi/v3/ohlcv?address=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&type=15m&currency=usd&time_from=1726700000&time_to=1726704000&mode=range&padding=false>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

Each item in data.items[] carries o, h, l, c, v, v_usd, and unix_time, which maps one to one onto a TradingView bar object. To chart a specific pool rather than an aggregated token, call /defi/v3/ohlcv/pair with the pool address. It takes the same time and type params, drops currency, and adds inversion to flip the base and quote sides.

With the viewport filled, handle the user scrolling back into history.

Stage 3: Backfill History on Scroll Back

Endpoint: GET /defi/v3/ohlcv, GET /defi/history_price

Chains: All supported networks

Docs: Price – Historical

When the user pans left, request an older window by shifting time_from and time_to to the period just before your earliest loaded candle, keeping the same type so the series stays continuous. TradingView calls your datafeed repeatedly as the user scrolls, so this is just the same OHLCV call with an earlier window.

For very long ranges where a candle by candle load is wasteful, fall back to history_price, which returns a lightweight line series of unixTime and value points. It takes address, address_type (token or pair), type, time_from, and time_to.

curl --request GET \
  --url '<https://public-api.birdeye.so/defi/history_price?address=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&address_type=token&type=15m&time_from=1726600000&time_to=1726700000>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

Second level candles have limited retention: 1s is kept for 2 weeks, and 15s and 30s for 3 months. Cap the second level intervals to recent ranges in your UI, and switch to 1m and above for anything deeper, or backfill requests will come back empty.

Stage 4: Keep the Last Candle Live

This is the layer that makes your Solana TradingView Chart feel real time, and it is the one place where your package tier changes the implementation.

On any paid tier: poll the latest candle

Request the latest one or two candles on a short interval with mode=count, then merge the newest bar into the chart. This works on every paid tier, Standard through Enterprise, with no WebSocket.

curl --request GET \
  --url '<https://public-api.birdeye.so/defi/v3/ohlcv?address=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&type=1m&currency=usd&mode=count&count_limit=2&time_to=1726704000>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

A poll interval close to the candle interval is usually enough. For a 1m chart, polling every few seconds keeps the forming bar fresh without wasting credits. Watch your budget with the credits endpoint in the next section and back off the interval if needed.

On Premium and up: stream over WebSocket

Endpoint: SUBSCRIBE_PRICE, SUBSCRIBE_TXS

Plan availability: Premium, Business, and Enterprise per the Data Accessibility table. Note: the WebSocket docs page still lists Business and up, so the two pages conflict. Confirm streaming access against your own key before relying on it.

Docs: WebSocket – Price/OHLCV

For the lowest latency live bar, open one socket and subscribe to the price stream. The chain goes in the URL path, not a header.

const ws = new WebSocket(
  `wss://public-api.birdeye.so/socket/solana?x-api-key=${API_KEY}`,
  "echo-protocol"
);

ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "SUBSCRIBE_PRICE",
    data: {
      queryType: "simple",
      chartType: "1m",
      address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
      currency: "usd",
      mode: "raw"
    }
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === "PRICE_DATA") {
    // msg.data: { eventType: "ohlcv", o, h, l, c, v, unixTime, symbol, address }
    updateLastCandle(msg.data);
  }
};

Three things that bite people on the socket:

  • One subscription per message type. Sending a new SUBSCRIBE_PRICE overwrites the previous one. To follow several tokens, send a single complex query with all of them (up to 100) and resend the full list whenever it changes. Because the limit is per type, you can run SUBSCRIBE_PRICE and SUBSCRIBE_TXS on the same socket at once.
  • Implement ping pong. The docs explicitly recommend a ping pong keepalive so the connection is not dropped on idle network. Add reconnection with a backfill of missed candles over REST on reconnect.
  • Node needs headers. In the browser the Origin and Sec-WebSocket-Protocol: echo-protocol values are set for you. In Node, set them explicitly on the client.

To add a trade tape or volume markers, subscribe to SUBSCRIBE_TXS, which returns TXS_DATA events carrying blockUnixTime, owner, source, and txHash.

Stage 5: Add a Liquidity Overlay

Endpoint: GET /defi/v3/liquidity/ohlc/pair

Chains: Solana only

Docs: Liquidity OHLC – Pair

Most charts stop at price. A liquidity ribbon under the candles is a feature competitors rarely expose, and it is one call. This endpoint returns liquidity as OHLC for a Solana pool, up to 100 records per request, anchored at a timestamp and paged by direction rather than a time_from/time_to range.

curl --request GET \
  --url '<https://public-api.birdeye.so/defi/v3/liquidity/ohlc/pair?address=YOUR_PAIR_ADDRESS&time=1726704000&direction=back&count=100>' \
  --header 'accept: application/json' \
  --header 'x-chain: solana' \
  --header 'X-API-KEY: YOUR_API_KEY'

Each item carries the open, high, low, and close liquidity in USD for the window. To page older liquidity candles, set direction=back and move the time anchor to just before your earliest loaded candle; use direction=forward to move toward the present. With time omitted, the anchor defaults to the latest available candle.

Utility: Monitor Your CU Budget

Endpoint: GET /utils/v1/credits

Docs: Utils – Credits Usage

If you poll for the live layer, wire this in from day one so a tight interval does not quietly burn your budget.

curl --request GET \
  --url '<https://public-api.birdeye.so/utils/v1/credits>' \
  --header 'X-API-KEY: YOUR_API_KEY'

With no parameters it returns the current cycle: total usage split into REST api and WebSocket ws, remaining credits, and overage fields. A practical pattern: poll hourly and widen your live poll interval automatically if remaining credits drop below a safe threshold, rather than running into a 429 mid session.

Putting It Together: Reference Architecture

Reference architecture for a Solana TradingView Chart API on Birdeye Data: resolve, seed, backfill, and live candle layers.

For your Solana TradingView Chart, build it in that order: paint the visible viewport first, attach the live layer last, and backfill only when the user scrolls. On any tier the live layer can be a short interval poll of the latest OHLCV candle. From Premium up you can swap that one function for a SUBSCRIBE_PRICE socket with ping pong and reconnect, and leave everything else as is.

Checklist before you ship your Solana TradingView Chart:

  • The history call uses padding=false so the chart does not invent flat candles.
  • Backfill keeps the same type, and second level intervals are capped to their retention windows.
  • The live layer degrades gracefully: REST poll on any tier, WebSocket from Premium up.
  • The price stats parser branches on chain if you target EVM later.
  • Credit usage is observable so a tight poll interval cannot surprise you with a 429.

FAQ

Which intervals does the Solana TradingView Chart API support?

The V3 OHLCV endpoint covers 1s through 1M, including the second level 1s, 15s, and 30s intervals on Solana that most competitors do not offer.

How many candles can one request return?

Up to 5,000 records per OHLCV V3 call. For more history, page by shifting the time window.

How far back does candle history go?

Minute and higher intervals reach far back. Second level intervals are limited: 1s for 2 weeks, 15s and 30s for 3 months.

Do I need a WebSocket to make the chart live?

No. REST polling of the latest OHLCV candle keeps the chart live on every paid tier and is the primary path here. WebSocket streaming is available from the Premium package up per the Data Accessibility table, as a lower latency option.

How do I chart a specific pool instead of the token?

Use /defi/v3/ohlcv/pair with the pool address, and set inversion if you need to flip base and quote.

Why are my older second level candles empty?

They fell outside the retention window. Switch to 1m or higher for ranges beyond the second level limits above.


You now have the full Solana TradingView Chart data layer, from first paint to live candle. Get an API key at Birdeye Data to start building, and keep the full endpoint reference handy. To skip the boilerplate, start from the official TradingView datafeed example at github.com/birdeye-so/tradingview-example-js-api.

Read next

Step-by-step developer guide to building a Solana portfolio tracker with Birdeye Data: wallet holdings and net worth in one call, a 90-point net worth chart, server-computed PnL with win rate, and lazy-loaded price sparklines under the Wallet API beta rate limit.
Build a rug checker API with Birdeye Data: scan contract authority, mint and burn events, holder concentration, and real sellability across Solana and EVM.
Build a Solana new token sniper API with Birdeye Data: detect new token launches, gate every hit for rug risk, rank momentum, and watch positions over REST or WebSocket.
Don't miss out on what's next
Subscribe now and be the first to catch trends, tools, and exclusive updates.
© 2025, Wings Lab Pte. Ltd