Create live charts with the Solana Tracker Data API and TradingView Advanced Charts. TradingView's charts also let you track every crypto pair, including the BTCUSD price in real time.
This guide walks you through building live charts with the Solana Tracker Data API and TradingView Advanced Charts in a Next.js application.
Prerequisites
- Basic knowledge of Next.js and React
- A Solana Tracker Data API key (live websocket updates require the Premium package)
- Access to TradingView Advanced Charts
Step 1: Request TradingView Advanced Charts access
Before you begin, request access to TradingView Advanced Charts:
- Visit TradingView Advanced Charts
- Follow the instructions to request access
- Wait for approval (this may take some time)
Step 2: Set up the project
Clone the example repository:
git clone https://github.com/solanatracker/solana-chart-example.git
cd solana-chart-example
Install dependencies:
npm install
Create a .env file in the root directory and add your Solana Tracker Data API key:
NEXT_PUBLIC_DATA_API_KEY=your_api_key_here
NEXT_PUBLIC_DATASTREAM=your_datastream_url_here
Step 3: Run the application
Start the development server:
npm run dev
Visit http://localhost:3000 to see your live Solana chart.
Conclusion
You now have a live Solana chart built with the Solana Tracker Data API and TradingView Advanced Charts in a Next.js application. It's a foundation for more complex charting applications with real-time data.
To customize it, edit DataFeed.tsx. If you don't have Datastream access, change DataFeed.tsx to poll the /price endpoint at an interval instead.