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

# Lịch sử OHLC

> Truy vấn thông tin lịch sử nến (open, high, low, close, volume) cho Cổ phiếu, Phái sinh và Chỉ số thị trường theo khung thời gian và khoảng thời gian cụ thể.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-07-23.yaml get /price/ohlc
openapi: 3.0.0
info:
  title: OpenAPI-V2-Spec 260730
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
security: []
paths:
  /price/ohlc:
    get:
      tags:
        - market-data
      summary: Lịch sử OHLC
      description: >-
        Truy vấn thông tin lịch sử nến (open, high, low, close, volume) cho Cổ
        phiếu, Phái sinh và Chỉ số thị trường theo khung thời gian và khoảng
        thời gian cụ thể.
      parameters:
        - name: symbol
          in: query
          required: true
          description: 'Mã chứng khoán '
          schema:
            type: string
          example: ACB
        - name: type
          in: query
          description: |-
            Loại thị trường
            - STOCK: Cổ phiếu
            - DERIVATIVE: Phái sinh
            - INDEX: Chỉ số thị trường
          schema:
            type: string
          example: STOCK
        - name: resolution
          in: query
          required: true
          description: |-
            Khung thời gian nến
            - 1,3,5,15,30,1h,1D,1W
          schema:
            type: string
          example: '15'
        - name: from
          in: query
          required: true
          description: Thời gian bắt đầu
          schema:
            type: integer
          example: 1773657310
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc
          schema:
            type: integer
          example: 1773830110
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 450
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:01:24 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Content-Type-Options:
              schema:
                type: string
              example: nosniff
            X-Frame-Options:
              schema:
                type: string
              example: SAMEORIGIN
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Request-Id:
              schema:
                type: string
              example: 1DSZCcoZ9h5P6OTR0NgZwGUPw1C9lsEd
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              schema:
                type: string
              example: 1; mode=block
          content:
            application/json:
              schema:
                type: object
                description: Dữ liệu biểu đồ nến (OHLCV) theo từng khoảng thời gian.
                properties:
                  t:
                    type: array
                    description: >-
                      Danh sách thời gian của từng cây nến, định dạng Unix
                      Timestamp (giây).
                    items:
                      type: integer
                      format: int64
                      example: 1773715500
                  o:
                    type: array
                    description: Danh sách giá mở cửa (Open) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.8
                  h:
                    type: array
                    description: Danh sách giá cao nhất (High) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.9
                  l:
                    type: array
                    description: Danh sách giá thấp nhất (Low) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.7
                  c:
                    type: array
                    description: Danh sách giá đóng cửa (Close) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.75
                  v:
                    type: array
                    description: >-
                      Danh sách khối lượng giao dịch (Volume) tương ứng với từng
                      cây nến.
                    items:
                      type: integer
                      format: int64
                      example: 2530900
                  nextTime:
                    type: integer
                    format: int64
                    example: 0
                    description: >-
                      Mốc thời gian (Unix Timestamp, giây) của cây nến tiếp theo
                      khi dữ liệu hiện tại chưa đủ để đáp ứng yêu cầu. Giá trị 0
                      nếu không còn dữ liệu.
                required:
                  - t
                  - o
                  - h
                  - l
                  - c
                  - v
                  - nextTime
                example:
                  t:
                    - 1773715500
                    - 1773716400
                    - 1773800100
                  o:
                    - 23.8
                    - 23.75
                    - 23.75
                  h:
                    - 23.8
                    - 23.8
                    - 23.9
                  l:
                    - 23.7
                    - 23.7
                    - 23.7
                  c:
                    - 23.75
                    - 23.75
                    - 23.8
                  v:
                    - 2530900
                    - 514100
                    - 494000
                  nextTime: 0
              example:
                t:
                  - 1773715500
                  - 1773716400
                  - 1773800100
                  - 1773801000
                  - 1773801900
                  - 1773802800
                  - 1773803700
                  - 1773804600
                  - 1773805500
                  - 1773806400
                o:
                  - 23.8
                  - 23.75
                  - 23.75
                  - 23.85
                  - 23.8
                  - 23.85
                  - 23.9
                  - 23.75
                  - 23.8
                  - 23.8
                h:
                  - 23.8
                  - 23.8
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.8
                  - 23.8
                l:
                  - 23.7
                  - 23.7
                  - 23.7
                  - 23.8
                  - 23.75
                  - 23.8
                  - 23.7
                  - 23.75
                  - 23.7
                  - 23.75
                c:
                  - 23.75
                  - 23.75
                  - 23.8
                  - 23.85
                  - 23.8
                  - 23.9
                  - 23.85
                  - 23.75
                  - 23.75
                  - 23.75
                v:
                  - 2530900
                  - 514100
                  - 494000
                  - 344400
                  - 429000
                  - 315300
                  - 582100
                  - 205300
                  - 361300
                  - 3040800
                nextTime: 0
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.