# 依代幣地址取得幣種價格

**API:** Data API

**Endpoint:** `GET /v1/beta/coingecko/simple/token_price/{id}`

**Tags:** CoinGecko

以鏈上合約地址而非 CoinGecko id 為鍵的價格查詢。`id` 是資產平台，`contract_addresses` 是以逗號分隔的代幣地址清單，`vs_currencies` 是計價貨幣。傳回以小寫合約地址為鍵的對照表，其欄位名稱由計價貨幣組成——`usd`，若設定對應的 `include_market_cap`、`include_24hr_vol`、`include_24hr_change` 與 `include_last_updated_at` 旗標，還會加上 `usd_market_cap`、`usd_24h_vol`、`usd_24h_change` 與 `last_updated_at`。當你持有地址而沒有 id 時使用。代幣的完整檔案請用 `get_coingecko_token_data`；若已有 CoinGecko id，請用 `get_coingecko_simple_price`。

### 定價參考

- 計量方式：方案資源單位。
- 參考請求預估：USD 0.008。
- 單位成本基礎：USD 0.0。
- 資源單位：`provider_credit`。
- 成本基礎不構成最終客戶價格，即使為零亦同。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `id` | path | yes | string, default: "ethereum" | 資產平台 ID。 *參見 [`/asset_platforms`](/reference/asset-platforms-list) |
| `contract_addresses` | query | yes | string, default: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599" | 代幣合約地址；查詢多個代幣時以逗號分隔 |
| `include_24hr_change` | query | no | boolean | 包含 24 小時漲跌幅。 預設值：false |
| `include_24hr_vol` | query | no | boolean | 包含 24 小時交易量。 預設值：false |
| `include_last_updated_at` | query | no | boolean | 包含最後更新價格時間（UNIX 時間戳）。 預設值：false |
| `include_market_cap` | query | no | boolean | 包含市值。 預設值：false |
| `precision` | query | no | string, enum: "full", "0", "1", "2", "3", "4", … | 貨幣價格值的小數位數 |
| `vs_currencies` | query | yes | string, default: "usd" | 幣種的目標計價貨幣；查詢多個貨幣時以逗號分隔。 *參見 [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies) |

## Responses

### 200 — 代幣價格

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: `Response860C3Ae68Ea5_SimplePrice` (`#/components/schemas/Response860C3Ae68Ea5_SimplePrice`)

Example:

```json
{
  "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599": {
    "usd": 76721,
    "usd_market_cap": 9008047197.715635,
    "usd_24h_vol": 181232010.10689816,
    "usd_24h_change": -1.6069562341774564,
    "last_updated_at": 1779094527
  }
}
```

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 402 — 由於未符合計費要求，要求無法繼續。

### 403 — 該帳戶無權執行此操作。

### 429 — 已達到要求或支出上限。

### 502 — 服務無法完成該要求。

### 503 — API 或計費服務暫時無法使用。

### 504 — 服務在處理要求時逾時。

### default — 錯誤回應；上游透傳回應可能採用供應商格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response860C3Ae68Ea5_SimplePrice

`#/components/schemas/Response860C3Ae68Ea5_SimplePrice`

```json
{
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "properties": {
      "usd": {
        "type": "number",
        "description": "以目標貨幣計的價格"
      },
      "usd_market_cap": {
        "type": "number",
        "description": "以目標貨幣計的市值"
      },
      "usd_24h_vol": {
        "type": "number",
        "description": "以目標貨幣計的 24 小時交易量"
      },
      "usd_24h_change": {
        "type": "number",
        "description": "以目標貨幣計的 24 小時價格漲跌幅"
      },
      "last_updated_at": {
        "type": "number",
        "description": "最後更新時間戳（UNIX 秒）"
      }
    }
  }
}
```
