Runnable TypeScript projects for the guides at solanatracker.io/resources. Each folder is a standalone Node.js project with its own package.json, .env.example, and README.
Requires Node.js 20.18 or later (24 LTS recommended).
git clone https://github.com/solanatracker/examples.git
cd examples/01-get-solana-token-price-api
cp .env.example .env # add ST_API_KEY
npm install
npm startEvery example validates its environment on startup and exits with a one-line message naming any missing variable. Streaming examples reconnect with capped exponential backoff and stop cleanly on Ctrl+C. npm run typecheck type-checks a project without running it.
- 01-get-solana-token-price-api: make a REST call, handle errors and retries.
- 02-realtime-solana-price-websocket: subscribe to a Datastream room with automatic reconnect.
- 04-stream-pumpfun-launches-websocket: consume a high-volume launch feed.
- 07-yellowstone-grpc-setup: open a Yellowstone gRPC stream and answer pings.
- 09-raydium-stream-and-parse-amm-transactions: decode program instructions from raw transactions.
Request/response data with an ST_API_KEY. Start here. Product: Solana Data API.
| Folder | Example | Tutorial |
|---|---|---|
| 01-get-solana-token-price-api | Solana token prices per pool and in batches | Guide |
| 11-solana-token-ohlcv-chart-api | Solana OHLCV candles with gap handling | Guide |
| 12-check-solana-token-rug-risk-api | Solana rug check risk gate | Guide |
| 14-solana-token-search-screener-api | Solana token screener | Guide |
| 19-solana-lighthouse-market-activity-api | Solana market activity leaderboard | Guide |
| 03-solana-wallet-portfolio-api | Solana wallet portfolio tracker | Guide |
| 20-solana-pnl-history-currency-api | Solana wallet PnL history in USD, SOL or EUR | Guide |
| 16-solana-pnl-leaderboard-api | Solana PnL leaderboard | Guide |
| 21-solana-wallet-identity-enrichment | Solana wallet identity labels for trades and holders | Guide |
Live rooms over WebSocket. Needs ST_DATASTREAM_KEY (Premium plan or higher). Product: Solana Data API.
| Folder | Example | Tutorial |
|---|---|---|
| 02-realtime-solana-price-websocket | Stream Solana token prices over WebSocket | Guide |
| 15-stream-solana-trades-websocket | Stream Solana trades over WebSocket | Guide |
| 17-solana-liquidity-history-websocket | Solana liquidity events: REST backfill + live stream | Guide |
| 18-jupiter-dca-api-recurring-orders | Jupiter DCA orders: REST snapshot + live events | Guide |
Launches, bonding curves, graduations, and early buyers. Same Data API keys. Product: Pump.fun API.
| Folder | Example | Tutorial |
|---|---|---|
| 04-stream-pumpfun-launches-websocket | Stream Pump.fun launches over WebSocket | Guide |
| 05-detect-pumpfun-graduation | Detect Pump.fun graduations | Guide |
| 13-pumpfun-first-buyers-sniper-api | Pump.fun first buyers and sniper report | Guide |
Raw on-chain streams decoded in your own process. Needs a gRPC endpoint and token. Product: Yellowstone gRPC.
| Folder | Example | Tutorial |
|---|---|---|
| 07-yellowstone-grpc-setup | Yellowstone gRPC setup | Guide |
| 08-pumpfun-stream-new-minted-tokens | Stream new Pump.fun mints over gRPC | Guide |
| 09-raydium-stream-and-parse-amm-transactions | Parse Raydium AMM v4 swaps from gRPC | Guide |
| 10-meteora-dlmm-transaction-parsing | Parse Meteora DLMM swaps from gRPC | Guide |
| 22-yellowstone-grpc-account-subscribe | Stream a wallet's SOL and token balances over gRPC | Guide |
Measure and compare RPC endpoints. Product: Solana RPC.
| Folder | Example | Tutorial |
|---|---|---|
| 06-reduce-solana-rpc-latency | Solana RPC latency benchmark | Guide |
Quote, build, sign, send and track swaps. No API key. Product: Raptor Swap API.
| Folder | Example | Tutorial |
|---|---|---|
| 23-solana-swap-api-typescript | Solana swap API: quote, build, sign, send and track | Guide |
Copy .env.example to .env in the folder you are running. Never commit .env.
| Variable | Used by | Description |
|---|---|---|
ST_API_KEY |
01, 02, 03, 04, 05, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 | Data API key from the Data API dashboard |
ST_DATASTREAM_KEY |
02, 03, 04, 05, 13, 15, 17, 18 | Datastream key or full wss:// URL from the Data API dashboard (Premium plan or higher) |
YELLOWSTONE_GRPC_ENDPOINT |
07, 08, 09, 10, 22 | gRPC endpoint from the Yellowstone gRPC dashboard |
YELLOWSTONE_GRPC_TOKEN |
07, 08, 09, 10, 22 | x-token from the same dashboard |
SOLANA_RPC_URL |
06, 22 | RPC URL including ?api_key= from the RPC dashboard |
RPC_URLS |
06 | Comma-separated RPC URLs to compare |
DATA_API_BASE_URL |
01, 02, 03, 11, 15, 16, 20, 21 | Optional Data API base URL override; leave unset to use the default |
Other variables (token mints, limits, thresholds) are optional per-example inputs with defaults; each folder's README and .env.example describe them.
Kit-based examples include the same small helpers in src/:
env.ts: loads.envand validates required variables.client.ts: Data API client with per-request timeout and capped exponential retry that respectsRetry-After.datastream.ts: Datastream client with reconnect backoff and Ctrl+C shutdown.grpc.ts: Yellowstone gRPC stream with ping replies, reconnect backoff, and full request replay.format.ts: number, address, and table formatting.
- Guides
- Documentation
- Solana Data API · Pump.fun API · Yellowstone gRPC · Solana RPC · Dedicated Nodes · Raptor
These folders are generated from the Solana Tracker site repository (scripts/sync-resource-examples.mjs). Direct edits here are overwritten on the next sync.