# 匯率行情

查詢幣種的 USD 匯率（時點 / 最新 / 歷史）。回應包在 `{ data, meta }` 信封。

## 查價（時點 / 最新，批次）

```bash
# 最新價（多幣）
curl "https://api.atlantis.example/v1/rates?symbols=BTC,ETH" \
  -H "X-API-Key: ak_live_YOUR_KEY"

# 某時點（unix 秒）
curl "https://api.atlantis.example/v1/rates?symbols=BTC,ETH&at=1700000000" \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

| 參數        | 必填 | 說明                  |
| --------- | -- | ------------------- |
| `symbols` | 是  | 逗號分隔幣種（如 `BTC,ETH`） |
| `at`      | 否  | 時點 unix 秒；省略=最新     |

```json
{
  "data": {
    "at": 1700000000,
    "rates": [
      { "symbol": "BTC", "price_usd": 37500.5, "ts": 1699999200 },
      { "symbol": "ETH", "price_usd": 2050.5,  "ts": 1699999200 }
    ]
  },
  "meta": { "request_id": "..." }
}
```

> 查某時點時，回傳的是「該時間點之前最後一筆」的價，並附該筆的 `ts`。**免費（0 credit）**。

## 歷史序列

```bash
curl "https://api.atlantis.example/v1/rates/history?symbol=BTC&start=1700000000&end=1700086400" \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{
  "data": {
    "symbol": "BTC",
    "points": [
      { "ts": 1700000000, "price_usd": 37500.5 },
      { "ts": 1700003600, "price_usd": 37520.1 }
    ]
  },
  "meta": { "request_id": "..." }
}
```

成功扣 **5 credit**。

## 有資料的幣種

```bash
curl https://api.atlantis.example/v1/rates/symbols \
  -H "X-API-Key: ak_live_YOUR_KEY"
```

```json
{ "data": { "symbols": ["BTC","ETH","TRX","BNB","AVAX","MATIC"] }, "meta": { "request_id": "..." } }
```

**免費（0 credit）**。

## 端點與計費

| Method | 路徑                                      | 說明            | Credit |
| ------ | --------------------------------------- | ------------- | ------ |
| `GET`  | `/v1/rates?symbols=&at=`                | 時點 / 最新查價（批次） | 0      |
| `GET`  | `/v1/rates/history?symbol=&start=&end=` | 歷史價序列         | 5      |
| `GET`  | `/v1/rates/symbols`                     | 有資料的幣種        | 0      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockchainsecurity.asia/documentation/zi-liao-api/rates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
