# 依合約取得幣種歷史圖表

**API:** Data API

**Endpoint:** `GET /v1/beta/coingecko/coins/{id}/contract/{contract_address}/market_chart`

**Tags:** CoinGecko

以合約地址識別的代幣在 `days` 所設定之回溯期間內的歷史序列。`id` 是資產平台，`contract_address` 是代幣。傳回 `prices`、`market_caps` 與 `total_volumes`，為時間戳與值的配對，時間戳以毫秒為單位——結構與 `get_coingecko_coins_id_market_chart` 相同。當你持有地址而非 CoinGecko id 時使用。若需要明確的起訖時間，請用 `get_coingecko_token_market_chart_range`。

### 定價參考

- 計量方式：方案資源單位。
- 參考請求預估：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 |
| --- | --- | --- | --- | --- |
| `contract_address` | path | yes | string, default: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" | 代幣的合約地址。 |
| `id` | path | yes | string, default: "ethereum" | 資產平台 ID。 *參見 [`/asset_platforms`](/reference/asset-platforms-list)。 |
| `days` | query | yes | string, default: "1" | 截至若干天前的資料。 天數可使用任意整數或 `max`。 |
| `interval` | query | no | string, enum: "1m", "5m", "hourly", "daily" | 資料間隔，留空則自動選擇粒度。 |
| `precision` | query | no | string, enum: "full", "0", "1", "2", "3", "4", … | 貨幣價格值的小數位數。 |
| `vs_currency` | 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_CoinsMarketChart` (`#/components/schemas/Response860C3Ae68Ea5_CoinsMarketChart`)

Example:

```json
{
  "prices": [
    [
      1779619498604,
      0.9997624087636037
    ],
    [
      1779619877081,
      0.9997817655336941
    ]
  ],
  "market_caps": [
    [
      1779619498604,
      76419636272.78033
    ],
    [
      1779619877081,
      76424065983.84229
    ]
  ],
  "total_volumes": [
    [
      1779619498604,
      9374311493.936354
    ],
    [
      1779619877081,
      9390008044.485624
    ]
  ]
}
```

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

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

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

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

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

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

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

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

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

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response860C3Ae68Ea5_CoinsMarketChart

`#/components/schemas/Response860C3Ae68Ea5_CoinsMarketChart`

```json
{
  "type": "object",
  "required": [
    "prices",
    "market_caps",
    "total_volumes"
  ],
  "properties": {
    "prices": {
      "type": "array",
      "description": "價格資料點，形式為 [timestamp, price] 資料對",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "market_caps": {
      "type": "array",
      "description": "市值資料點，形式為 [timestamp, market_cap] 資料對",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "total_volumes": {
      "type": "array",
      "description": "總交易量資料點，形式為 [timestamp, volume] 資料對",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  }
}
```
