> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 池子 - K 线

> 获取特定流动性池子的 OHLCV K 线数据



## OpenAPI

````yaml /cn/api-reference/openapi-data-cn.yaml GET /v2/token/{chain}/pool/{poolAddress}/candles
openapi: 3.1.0
info:
  title: Services API
  description: Services API
  contact:
    name: AI
    email: ai@sx.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.chainstream.io
    description: Production
security:
  - bearer_auth: []
  - api_key_auth: []
tags:
  - name: Blockchain
    description: 区块链相关操作
  - name: Token
    description: 代币相关操作
  - name: Trade
    description: 交易相关操作
  - name: Wallet
    description: 钱包相关操作
  - name: Dex
    description: DEX 相关操作
  - name: Ranking
    description: 排行榜相关操作
  - name: DexPool
    description: DEX 池子相关操作
  - name: Watchlist
    description: 关注列表相关操作
  - name: KYT
    description: KYT 相关操作
  - name: Webhook
    description: Webhook 相关操作
  - name: RedPacket
    description: 红包相关操作
  - name: IPFS
    description: IPFS 相关操作
  - name: DexScreener
    description: DexScreener 相关操作
paths:
  /v2/token/{chain}/pool/{poolAddress}/candles:
    get:
      tags:
        - Token
      summary: 池子 - K 线
      description: 获取特定流动性池子的 OHLCV K 线数据
      operationId: get.pool.candles
      parameters:
        - name: chain
          in: path
          description: 支持网络列表中的链名称
          required: true
          schema:
            $ref: '#/components/schemas/ChainSymbol'
          example: sol
        - name: poolAddress
          in: path
          description: 池子地址
          required: true
          schema:
            type: string
          example: 8sLbNZoA1cfnvMJLPfp98ZLAnFSYCFApfJKMbiXNLwxj
        - name: resolution
          in: query
          description: K 线数据的时间粒度
          required: true
          schema:
            $ref: '#/components/schemas/Resolution'
          example: 1h
        - name: priceType
          in: query
          description: 价格类型：usd（默认）或原生代币价格
          required: false
          schema:
            oneOf:
              - $ref: '#/components/schemas/PriceType'
            default: usd
          example: usd
        - name: from
          in: query
          description: 开始时间戳（Unix 秒级时间戳）
          required: false
          schema:
            type: integer
            format: int64
          example: 1741647950000
        - name: to
          in: query
          description: 结束时间戳（Unix 秒级时间戳）
          required: false
          schema:
            type: integer
            format: int64
          example: 1741700970000
        - name: limit
          in: query
          description: 返回的 K 线数量
          required: false
          schema:
            type: integer
            format: int64
          example: 100
      responses:
        '200':
          description: 获取池子 K 线
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TokenCandle'
components:
  schemas:
    ChainSymbol:
      type: string
      description: Supported blockchain chains
      enum:
        - sol
        - eth
        - bsc
    Resolution:
      type: string
      description: Candle resolution
      enum:
        - 1s
        - 15s
        - 30s
        - 1m
        - 3m
        - 5m
        - 15m
        - 30m
        - 1h
        - 2h
        - 4h
        - 6h
        - 8h
        - 12h
        - 1d
        - 3d
        - 1w
        - 1M
    PriceType:
      type: string
      description: Price type for candle data
      enum:
        - usd
        - native
    TokenCandle:
      type: object
      description: Token candle (OHLCV)
      required:
        - timestamp
        - open
        - high
        - low
        - close
        - volume
      properties:
        close:
          type: string
          description: Close price
          example: '51.2'
        high:
          type: string
          description: High price
          example: '51.8'
        low:
          type: string
          description: Low price
          example: '50.1'
        open:
          type: string
          description: Open price
          example: '50.5'
        timestamp:
          type: integer
          format: int64
          description: Timestamp
          example: 1709251200000
        trades:
          type:
            - integer
            - 'null'
          format: int64
          description: Number of trades (swaps) in this candle bar
          example: 128
        volume:
          type: string
          description: Volume in USD or native currency (depending on priceType)
          example: '1000000'
        volumeInTokenAmount:
          type:
            - string
            - 'null'
          description: Base token quantity (e.g. number of CAKE or SOL tokens traded)
          example: '42000.5'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    api_key_auth:
      type: apiKey
      in: header
      name: X-API-KEY

````