> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmquantdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 加密货币实时快照

> 加密货币交易对的当前价格 + 24h 行情。

<Note icon="sparkles">
  **已暴露为 MCP 工具**：`crypto_snapshot` —— 在 Claude / Cursor / 任意 MCP 客户端中直接调用。详见 [MCP Server](/zh-CN/integration/mcp-server) 60 秒配置。
</Note>

<Badge color="green" icon="circle-check">已上线</Badge>
 
<Badge color="gray" size="sm">免费 · snapshot</Badge>

## 它为 Agent 做什么

`crypto_snapshot` 返回单个加密货币交易对的当前现货价格 + 24 小时涨跌与成交量。它是 agent 的 **价格 checkpoint**——任务过程中要验证当前价位、比较资产、或给市场打一个 regime tag 时，不需要拉完整 K 线，调它一次就够。

`crypto_snapshot({ ticker })` → `price`、`dayChange`、`dayChangePercent`、`volume24h`、`time`。仅此而已。

## 返回值

<ResponseField name="data" type="CryptoSnapshot" required>
  <Expandable title="CryptoSnapshot 字段">
    <ResponseField name="ticker" type="string" required>
      交易对，`BASE-QUOTE` 格式（如 `BTC-USD`）。
    </ResponseField>

    <ResponseField name="price" type="number" required>
      最新成交价。
    </ResponseField>

    <ResponseField name="dayChange" type="number" required>
      24 小时绝对涨跌。
    </ResponseField>

    <ResponseField name="dayChangePercent" type="number" required>
      24 小时涨跌幅（%）。
    </ResponseField>

    <ResponseField name="volume24h" type="number" required>
      24 小时基础资产成交量。
    </ResponseField>

    <ResponseField name="time" type="string" required>
      快照时间戳（ISO-8601 UTC）。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta.creditsUsed" type="number">固定 `0` —— 本接口免费。</ResponseField>
<ResponseField name="meta.remainingCredits" type="number">账户剩余 credit。</ResponseField>

```json title="200 OK · crypto_snapshot" expandable theme={null}
{
  "data": {
    "ticker": "BTC-USD",
    "price": 87200.00,
    "dayChange": 1200.50,
    "dayChangePercent": 1.26,
    "volume24h": 12345678,
    "time": "2026-04-29T12:30:00Z"
  },
  "meta": { "creditsUsed": 0, "remainingCredits": 99 }
}
```

## 说明

<Tip>
  需要**历史 K 线**用 `crypto_historical_klines` —— 返回 `1h`、`4h`、`1d` 或 `1w` 周期的 OHLCV 蜡烛。`crypto_snapshot` 只关心"现在"。
</Tip>

<Warning>
  **仅现货市场**。合约、永续、资金费率、持仓量都不通过这个工具暴露。
</Warning>

<Warning>
  非交易级实时。可能比最新市场成交滞后最多 30 秒，**不要拿来交易**。
</Warning>

## 直接调用

<Accordion title="HTTP / SDK 示例" icon="terminal">
  <CodeGroup>
    ```typescript MCP (Claude / Cursor) theme={null}
    {
      "method": "tools/call",
      "params": {
        "name": "crypto_snapshot",
        "arguments": { "ticker": "BTC-USD" }
      }
    }
    ```

    ```python Python (HTTP) theme={null}
    import os, requests

    resp = requests.get(
        "https://api.llmquantdata.com/api/crypto/snapshot",
        headers={"Authorization": f"Bearer {os.environ['LLMQUANT_API_KEY']}"},
        params={"ticker": "BTC-USD"},
    ).json()
    d = resp["data"]
    print(f"{d['ticker']}: ${d['price']:,.2f} ({d['dayChangePercent']:+.2f}%)")
    ```

    ```bash cURL theme={null}
    curl "https://api.llmquantdata.com/api/crypto/snapshot?ticker=BTC-USD" \
      -H "Authorization: Bearer $LLMQUANT_API_KEY"
    ```
  </CodeGroup>
</Accordion>

## 完整参数参考

<Accordion title="crypto_snapshot — 请求参数" icon="sliders">
  <ParamField query="ticker" type="string" required>
    交易对，`BASE-QUOTE` 格式。例：`BTC-USD`、`ETH-USD`、`SOL-USD`。
  </ParamField>
</Accordion>

## 相关接口

<Columns cols={2}>
  <Card title="加密货币历史 K 线" icon="chart-line" href="/zh-CN/api/prices/crypto-historical">
    `1h`、`4h`、`1d` 或 `1w` 周期的 OHLCV 蜡烛。
  </Card>

  <Card title="美股价格快照" icon="square-chart-gantt" href="/zh-CN/api/prices/equity-historical">
    同样的形态用在美股标的（不同 endpoint）。
  </Card>
</Columns>
