> ## 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.

# 币种历史图表

> 某种加密货币过去 N 天的历史市场数据（价格、市值、24 小时交易量）。



## OpenAPI

````yaml openapi/zh/coingecko.json GET /coingecko/coins/{id}/market_chart
openapi: 3.0.3
info:
  title: CoinGecko API
  version: 1.0.0
  description: >-
    通过 AIsa 网关路由的 CoinGecko 加密货币市场数据。涵盖代币元数据、实时和历史价格、OHLC、交易所、行情代码、类别及热门搜索。代理位于
    `https://api.coingecko.com/api/v3/` 的公共 CoinGecko v3 API。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - BearerAuth: []
paths:
  /coingecko/coins/{id}/market_chart:
    get:
      summary: 币种历史图表
      description: 某种加密货币的历史市场数据（价格、市值、24 小时交易量）。
      operationId: coingeckoCoinMarketChart
      parameters:
        - $ref: '#/components/parameters/CoinId'
        - $ref: '#/components/parameters/VsCurrency'
        - $ref: '#/components/parameters/Days'
        - name: interval
          in: query
          description: 数据间隔。CoinGecko 支持 `daily`；在支持的范围内也可使用 `hourly`。
          schema:
            type: string
            enum:
              - daily
              - hourly
        - name: precision
          in: query
          schema:
            type: string
          description: 使用 `full` 或 `0` 到 `18` 之间的值指定货币价格值的小数位数。
          example: '2'
      responses:
        '200':
          description: 三个时间序列数组。
          content:
            application/json:
              example:
                prices:
                  - - 1713398400000
                    - 67234.12
                  - - 1713402000000
                    - 67301.55
                market_caps:
                  - - 1713398400000
                    - 1321498765432
                total_volumes:
                  - - 1713398400000
                    - 25679876543
              schema:
                $ref: '#/components/schemas/CoinGeckoMarketChart'
components:
  parameters:
    CoinId:
      name: id
      in: path
      required: true
      description: CoinGecko 代币 ID（例如 `bitcoin`、`ethereum`）。通过 `/coins/list` 获取列表。
      schema:
        type: string
      example: bitcoin
    VsCurrency:
      name: vs_currency
      in: query
      required: true
      description: 价格的目标货币（例如 `usd`、`eur`、`btc`）。请参阅 `/simple/supported_vs_currencies`。
      schema:
        type: string
        default: usd
    Days:
      name: days
      in: query
      required: true
      description: 截至 N 天前的数据。接受 `1`、`7`、`14`、`30`、`90`、`180`、`365` 或 `max`。
      schema:
        type: string
      example: '7'
  schemas:
    CoinGeckoMarketChart:
      type: object
      properties:
        prices:
          type: array
          items:
            type: array
            items:
              type: number
        market_caps:
          type: array
          items:
            type: array
            items:
              type: number
        total_volumes:
          type: array
          items:
            type: array
            items:
              type: number
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AISA API Key

````