# 依合約取得幣種市場圖表範圍

**API:** Data API

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

**Tags:** CoinGecko

以合約地址識別的代幣在兩個明確時間點之間的歷史序列。`id` 是資產平台，`contract_address` 是代幣；`from` 與 `to` 是 Unix 時間戳（秒），而回應中的時間戳為毫秒。傳回 `prices`、`market_caps` 與 `total_volumes`，為時間戳與值的配對。當你持有地址與固定時間範圍時使用。若為回溯期間，請用 `get_coingecko_token_market_chart`；若持有 CoinGecko id 而非地址，請用 `get_coingecko_coins_id_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)。 |
| `from` | query | yes | string, default: "2025-12-22" | 開始日期，採用 ISO 日期字串（`YYYY-MM-DD` 或 `YYYY-MM-DDTHH:MM`）或 UNIX 時間戳記。 **為獲得最佳相容性，請使用 ISO 日期字串。** |
| `interval` | query | no | string, enum: "1m", "5m", "hourly", "daily" | 資料間隔，留空則自動選擇粒度。 |
| `precision` | query | no | string, enum: "full", "0", "1", "2", "3", "4", … | 貨幣價格值的小數位數。 |
| `to` | query | yes | string, default: "2025-12-31" | 結束日期，採用 ISO 日期字串（`YYYY-MM-DD` 或 `YYYY-MM-DDTHH:MM`）或 UNIX 時間戳記。 **為獲得最佳相容性，請使用 ISO 日期字串。** |
| `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": [
    [
      1735689600000,
      1.000540738607754
    ],
    [
      1735776000000,
      0.9995995563541714
    ]
  ],
  "market_caps": [
    [
      1735689600000,
      43945617394.42927
    ],
    [
      1735776000000,
      43740787028.36501
    ]
  ],
  "total_volumes": [
    [
      1735689600000,
      6544488766.849924
    ],
    [
      1735776000000,
      5447401746.320422
    ]
  ]
}
```

### 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"
        }
      }
    }
  }
}
```
