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

# 币种 OHLC

> 某种币的 OHLC K 线数据。



## OpenAPI

````yaml openapi/zh/coingecko.json GET /coingecko/coins/{id}/ohlc
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}/ohlc:
    get:
      summary: 币种 OHLC
      description: 某种币的 OHLC K 线数据。
      operationId: coingeckoCoinOhlc
      parameters:
        - $ref: '#/components/parameters/CoinId'
        - $ref: '#/components/parameters/VsCurrency'
        - name: days
          in: query
          required: true
          description: '`1`、`7`、`14`、`30`、`90`、`180`、`365`。'
          schema:
            type: string
          example: '7'
        - name: precision
          in: query
          schema:
            type: string
          description: 使用 `full` 或 `0` 到 `18` 之间的值指定货币价格值的小数位数。
          example: '2'
      responses:
        '200':
          description: OHLC 行数组：`[timestamp, open, high, low, close]`。
          content:
            application/json:
              example:
                - - 1713398400000
                  - 67000
                  - 67500
                  - 66900
                  - 67234.12
              schema:
                $ref: '#/components/schemas/CoinGeckoOHLC'
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
  schemas:
    CoinGeckoOHLC:
      type: array
      items:
        type: array
        items:
          type: number
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AISA API Key

````