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

# 按合约查询代币历史图表

> 按合约地址获取受支持平台上代币的历史市场数据。



## OpenAPI

````yaml openapi/zh/coingecko.json GET /coingecko/coins/{id}/contract/{contract_address}/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}/contract/{contract_address}/market_chart:
    get:
      summary: 按合约查询代币历史图表
      description: 按合约地址获取词元的历史市场数据。
      operationId: coingeckoCoinMarketChartByContract
      parameters:
        - name: id
          in: path
          required: true
          description: 平台 ID。
          schema:
            type: string
          example: ethereum
        - name: contract_address
          in: path
          required: true
          description: 合约地址。
          schema:
            type: string
        - $ref: '#/components/parameters/VsCurrency'
        - $ref: '#/components/parameters/Days'
        - name: precision
          in: query
          schema:
            type: string
          description: 使用 `full` 或 `0` 到 `18` 之间的值指定货币价格值的小数位数。
          example: '2'
      responses:
        '200':
          description: 数据结构与 `/coins/{id}/market_chart` 相同。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoinGeckoMarketChart'
components:
  parameters:
    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

````