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

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 加密货币行情数据

> 为自主智能体提供实时和历史加密货币行情数据——价格、币种详情、图表、OHLC K 线、按合约地址查询 token、市值筛选、交易所行情、分类、热门搜索和加密新闻。

[在 GitHub 上查看 →](https://github.com/AIsa-team/agent-skills/tree/main/financial/crypto-market-data)

**为自主智能体提供完整的加密货币行情数据。** 一个 `AISA_API_KEY` 即可解锁 CoinGecko——价格、图表、OHLC K 线、链上 token 查询、交易所行情、热门币种和新闻。智能体研究、筛选和跟踪加密市场所需的一切。

## 安装

```bash npx skills theme={null}
npx skills add AIsa-team/agent-skills --skill crypto-market-data
```

```bash AIsa CLI theme={null}
npm install -g @aisa-one/cli
aisa skills install crypto-market-data
```

安装完成后请启动新的智能体会话，以加载该 Skill。

## 智能体可以用它做什么？

> [card] 价格跟踪
>
> “获取当前 BTC 和 ETH 的 USD 与 EUR 价格，以及 24 小时涨跌幅。”

> [card] 历史图表
>
> “拉取比特币 30 天 USD 价格图表，用于我的仪表板。”

> [card] OHLC K 线
>
> “返回以太坊最近 7 天的 OHLC K 线数据。”

> [card] 链上 token 查询
>
> “识别地址 0xA0b8…eB48 上的 ERC-20 token 并获取其价格。”

> [card] 市值筛选
>
> “按市值降序显示排名前 25 的币种。”

> [card] 交易所研究
>
> “列出 Binance 行情，按信任评分排序。”

## 核心能力

* **简单价格** — 当前法币和加密货币价格，可选包含市值 / 24 小时成交量 / 24 小时涨跌幅
* **币种数据** — 完整币种资料、列表、历史快照、行情图表、OHLC K 线、行情
* **基于合约的查询** — 通过受支持平台（Ethereum、BSC、Polygon 等）上的合约地址解析 token，拉取其价格或完整资料
* **市场与筛选** — 按市值排列的币种，支持灵活排序和分页
* **分类** — 分类列表及每个分类下的市场排行榜（DeFi、AI、L1 等）
* **交易所** — 交易所列表、详细数据、交易对、ID 映射
* **热门与新闻** — 热门搜索关键词和当前加密新闻（CoinGecko 新闻受上游套餐限制）

## 快速上手

```bash theme={null}
export AISA_API_KEY="your-key"
```

### 简单价格

```bash theme={null}
# Current prices with 24h change
python3 scripts/coingecko_client.py simple price \
  --ids bitcoin,ethereum --vs usd,eur --include-24hr-change

# Or direct curl
curl "https://api.aisa.one/apis/v1/coingecko/simple/price?ids=bitcoin,ethereum&vs_currencies=usd,eur&include_24hr_change=true" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 市值筛选

```bash theme={null}
python3 scripts/coingecko_client.py coins markets \
  --vs usd --order market_cap_desc --per-page 25
```

### 历史图表

```bash theme={null}
python3 scripts/coingecko_client.py coins chart --id bitcoin --vs usd --days 30
```

### OHLC K 线

```bash theme={null}
python3 scripts/coingecko_client.py coins ohlc --id bitcoin --vs usd --days 7
```

### 按合约地址查询 token

```bash theme={null}
python3 scripts/coingecko_client.py coins contract \
  --platform ethereum \
  --address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
```

### 交易所行情

```bash theme={null}
python3 scripts/coingecko_client.py exchanges tickers \
  --id binance --order trust_score_desc
```

## 适用场景

* 加密货币价格跟踪与投资组合分析
* 通过链上合约地址识别 token
* 市值筛选与分类概览
* 交易所级别的研究（信任评分、交易对、行情）
* 用于报告和仪表板的当前与历史加密数据

## 不适用场景

* 传统股票数据——请使用 [MarketPulse](https://aisa.one/docs/zh/agent-skills/marketpulse.md)
* 预测市场订单簿深度——请使用 [Prediction Market Data](https://aisa.one/docs/zh/agent-skills/prediction-market-data.md)
* 链上钱包操作（余额查询、交易追踪）——需要其他专用工具

## 环境要求

* Python 3、`curl`、POSIX shell
* `AISA_API_KEY`（[在 aisa.one 注册](https://aisa.one)）
* 兼容 agentskills.io 标准运行框架

## 端点参考

| 端点 | 方法 | 用途 |
| - | - | - |
| `/coingecko/simple/price` | GET | [简单价格](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-simple-price.md) |
| `/coingecko/simple/supported_vs_currencies` | GET | [支持的货币](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-simple-supported-vs-currencies.md) |
| `/coingecko/simple/token_price/{id}` | GET | [按 token 地址查询价格](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-simple-token-price-id.md) |
| `/coingecko/coins/list` | GET | [币种列表](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-list.md) |
| `/coingecko/coins/markets` | GET | [币种市场](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-markets.md) |
| `/coingecko/coins/{id}` | GET | [按 ID 查询币种数据](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id.md) |
| `/coingecko/coins/{id}/history` | GET | [币种历史数据](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-history.md) |
| `/coingecko/coins/{id}/market_chart` | GET | [币种历史图表](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-market-chart.md) |
| `/coingecko/coins/{id}/market_chart/range` | GET | [币种行情图表区间](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-market-chart-range.md) |
| `/coingecko/coins/{id}/ohlc` | GET | [币种 OHLC](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-ohlc.md) |
| `/coingecko/coins/{id}/tickers` | GET | [币种行情](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-tickers.md) |
| `/coingecko/coins/{id}/contract/{contract_address}` | GET | [按 token 地址查询币种数据](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-contract-contract-address.md) |
| `/coingecko/coins/{id}/contract/{contract_address}/market_chart` | GET | [按合约查询历史图表](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-contract-contract-address-market-chart.md) |
| `/coingecko/coins/{id}/contract/{contract_address}/market_chart/range` | GET | [按合约查询历史图表区间](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-id-contract-contract-address-market-chart-range.md) |
| `/coingecko/coins/categories/list` | GET | [分类列表](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-categories-list.md) |
| `/coingecko/coins/categories` | GET | [带市场数据的分类](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-coins-categories.md) |
| `/coingecko/exchanges` | GET | [交易所列表](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-exchanges.md) |
| `/coingecko/exchanges/list` | GET | [交易所 ID 映射](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-exchanges-list.md) |
| `/coingecko/exchanges/{id}` | GET | [按 ID 查询交易所数据](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-exchanges-id.md) |
| `/coingecko/exchanges/{id}/tickers` | GET | [交易所行情](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-exchanges-id-tickers.md) |
| `/coingecko/search/trending` | GET | [热门搜索](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-search-trending.md) |
| `/coingecko/news` | GET | [加密新闻](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-news) |

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册，并在控制台创建一个 API key。
2. 在终端中设置：`export AISA_API_KEY="your-key"`。
3. 使用[安装](#安装)章节中的任一命令安装该 Skill，然后启动新的智能体会话。

## 相关

> [card] [CoinGecko API 参考](https://aisa.one/docs/zh/api-reference/coingecko/get_coingecko-simple-price.md)
>
> 该 Skill 封装的所有端点，附带交互式测试工具。

> [card] [MarketPulse](https://aisa.one/docs/zh/agent-skills/marketpulse.md)
>
> 股票市场版——股票、财务数据、报告、宏观经济。

> [card] [Prediction Market Data](https://aisa.one/docs/zh/agent-skills/prediction-market-data.md)
>
> Polymarket 和 Kalshi 的事件概率数据。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.