跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt

Use this file to discover all available pages before exploring further.

Data API 提供了多种获取代币价格的方式:单一实时价格、历史 K 线数据和批量多代币查询。

实时价格

price 端点返回任意代币的当前价格。
curl "https://data.solanatracker.io/price?token=So11111111111111111111111111111111111111112" \
  -H "x-api-key: YOUR_API_KEY"

多代币价格

需要一批代币的价格?使用多价格端点一次性获取它们,而不是发起单个请求。
curl "https://data.solanatracker.io/price/multi?tokens=So111...112,38Pgz...pump" \
  -H "x-api-key: YOUR_API_KEY"

OHLCV 图表数据

OHLCV 端点返回用于绘制图表的 K 线数据。OHLCV 表示开盘、最高、最低、收盘和成交量。 带有价格 K 线、成交量柱和持有者数据的 Solana 代币示例图表
curl "https://data.solanatracker.io/chart/{token}?type=1h&time_from=1710000000&time_to=1710086400" \
  -H "x-api-key: YOUR_API_KEY"

K 线间隔

type间隔
1s1 秒
5s5 秒
15s15 秒
1m1 分钟
3m3 分钟
5m5 分钟
15m15 分钟
30m30 分钟
1h1 小时
2h2 小时
4h4 小时
6h6 小时
8h8 小时
12h12 小时
1d1 天
3d3 天
1w1 周
1mn1 个月

特定池的图表

对于具有多个池的代币,请使用特定池 OHLCV 端点获取来自特定池的 K 线:
curl "https://data.solanatracker.io/chart/{token}/{pool}?type=1h" \
  -H "x-api-key: YOUR_API_KEY"

历史价格

特定时间的价格

timestamp price 端点返回代币在某个确切时间点的价值。
curl "https://data.solanatracker.io/price/history/timestamp?token={token}&timestamp=1710000000" \
  -H "x-api-key: YOUR_API_KEY"

价格历史(时间序列)

price history 端点返回历史价格数据点。
curl "https://data.solanatracker.io/price/history?token={token}" \
  -H "x-api-key: YOUR_API_KEY"

价格区间(最高/最低)

price range 端点返回时间窗口内的最低和最高价格。
curl "https://data.solanatracker.io/price/history/range?token={token}&time_from=1710000000&time_to=1710086400" \
  -H "x-api-key: YOUR_API_KEY"

示例:构建价格面板

const token = "38PgzpJYu2HkiYvV8qePFakB8tuobPdGm2FFEn7Dpump";
const headers = { "x-api-key": "YOUR_API_KEY" };

// Current price
const { price } = await fetch(
  `https://data.solanatracker.io/price?token=${token}`, { headers }
).then(r => r.json());

// Last 24h candles (1 hour intervals)
const now = Math.floor(Date.now() / 1000);
const candles = await fetch(
  `https://data.solanatracker.io/chart/${token}?type=1h&time_from=${now - 86400}&time_to=${now}`, { headers }
).then(r => r.json());

// ATH
const ath = await fetch(
  `https://data.solanatracker.io/tokens/${token}/ath`, { headers }
).then(r => r.json());

console.log(`Current: $${price}`);
console.log(`24h candles: ${candles.length}`);
console.log(`ATH: $${ath.highest}`);

开源图表示例

Liveline 图表

使用 Datastream WebSocket 的极简实时折线图。

TradingView 高级图表

带有实时 K 线更新的完整 TradingView 集成。

实时价格(WebSocket)

流式传输实时价格并构建实时更新的图表。

代币研究

完整的代币查询:统计、持有者、交易和事件。