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

# Real-time K-Line

> Get real-time K-line data for the current time period that is being formed and updated.

## Notes

* This endpoint returns K-line data for the current period being formed, data updates continuously with trades
* Suitable for real-time chart display, current price monitoring, and intraday dynamic updates
* Not recommended for historical backtesting, technical indicator statistics, or fixed data storage
* For completed period data, use Historical K-Line: `/v1/market/kline`

## Supported Markets

**Forex**, **Metals**, **Indices**, **US Stocks**, **HK Stocks**, **A-Shares**, **China Futures**, **Crypto**

Examples:

* Forex: EURUSD, GBPUSD, USDJPY
* Metals: XAUUSD, XAGUSD
* Indices: SPX, NDX, DJI
* US Stocks: AAPL.US, TSLA.US, MSFT.US
* HK Stocks: 700.HK, 9988.HK, 3690.HK
* A-Shares: 600519.SH, 000001.SZ, 920186.BJ
* China Futures: BU2609, IC2606, AP8888
* Crypto: BTCUSDT, ETHUSDT, ADAUSDT

## Request Parameters

| Parameter | Required | Description                                                                                                                                                                                               |
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| symbols   | Yes      | Trading symbol codes, comma-separated, e.g., AAPL.US,00700.HK                                                                                                                                             |
| interval  | Yes      | K-line period, options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1M                                                                                                                                      |
| type      | No       | Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an `AMBIGUOUS_SYMBOL` error, pass the value as indicated. Values: `stock`, `indices`, `crypto`, `forex`, `futures` |

## Response Fields

| Field             | Description                                  |
| ----------------- | -------------------------------------------- |
| symbol            | Trading Symbol                               |
| type              | Product type                                 |
| interval          | K-line period                                |
| klines            | K-line data array                            |
| └─ time           | K-line timestamp (milliseconds)              |
| └─ open           | Opening price                                |
| └─ high           | Highest price                                |
| └─ low            | Lowest price                                 |
| └─ close          | Closing price                                |
| └─ volume         | Trading volume                               |
| └─ quote\_volume  | Trading amount; normally omitted for futures |
| └─ open\_interest | Open interest; returned for futures          |


## OpenAPI

````yaml GET /v1/market/kline/latest
openapi: 3.0.0
info:
  title: TickDB API
  description: >-
    Unified real-time market data API — one connection for Forex, indices, US
    stocks, HK stocks, A-shares, China futures, and Crypto via REST and
    WebSocket.
  version: 1.0.2
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/market/kline/latest:
    get:
      summary: Latest K-line Data
      description: Get the latest candlestick data for one or more symbols
      parameters:
        - name: symbols
          in: query
          required: true
          description: Comma-separated symbols (e.g., AAPL.US,00700.HK)
          schema:
            type: string
            default: AAPL.US,00700.HK
            example: AAPL.US,00700.HK
        - name: interval
          in: query
          required: true
          description: K-line interval
          schema:
            type: string
            enum:
              - 1m
              - 3m
              - 5m
              - 15m
              - 30m
              - 1h
              - 2h
              - 4h
              - 1d
              - 1w
              - 1M
            default: 3m
            example: 3m
        - name: type
          in: query
          required: false
          description: >-
            Symbol type, optional. Not required when the symbol is unambiguous;
            if the API returns an AMBIGUOUS_SYMBOL error, pass the value as
            indicated
          schema:
            type: string
            enum:
              - stock
              - indices
              - crypto
              - forex
              - futures
            example: stock
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                        type:
                          type: string
                          enum:
                            - stock
                            - indices
                            - crypto
                            - forex
                            - futures
                        interval:
                          type: string
                        klines:
                          type: array
                          items:
                            type: object
                            properties:
                              time:
                                type: integer
                              open:
                                type: string
                              high:
                                type: string
                              low:
                                type: string
                              close:
                                type: string
                              volume:
                                type: string
                              quote_volume:
                                type: string
                                description: Trading amount; normally omitted for futures
                              open_interest:
                                type: string
                                description: Open interest; returned for futures
                    example:
                      - symbol: AAPL.US
                        interval: 3m
                        klines:
                          - time: 1773259020000
                            open: '260.86'
                            high: '261.05'
                            low: '260.7'
                            close: '260.81'
                            volume: '963419'
                            quote_volume: '251311057.55'
                      - symbol: 00700.HK
                        interval: 3m
                        klines:
                          - time: 1773293400000
                            open: '542.5'
                            high: '544.5'
                            low: '542'
                            close: '544.5'
                            volume: '80300'
                            quote_volume: '43656433.33'
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: Invalid parameters
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: Unauthorized
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````