> ## 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ử khớp lệnh

> Truy vấn thông tin lịch sử khớp lệnh của mã chứng khoán theo bảng giao dịch 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/{symbol}/trades
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/{symbol}/trades:
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: HPG
    get:
      tags:
        - market-data
      summary: Lịch sử khớp lệnh
      description: >-
        Truy vấn thông tin lịch sử khớp lệnh của mã chứng khoán theo bảng giao
        dịch và khoảng thời gian cụ thể.
      parameters:
        - name: boardId
          in: query
          description: |-
            Mã bảng giao dịch
            - G1: Lô chẵn
            - G4: Lô lẻ
            - T1: Thỏa thuận trong giờ (9h - 14h45)
            - T3: Thỏa thuận sau giờ (14h45 - 15h)
            - T4: Thỏa thuận lô lẻ trong giờ (9h - 14h45)
            - T6: Thỏa thuận lô lẻ sau giờ  (14h45 - 15h)
          schema:
            type: string
          example: G1
        - name: from
          in: query
          required: true
          description: Thời gian bắt đầu (timestamp)
          schema:
            type: integer
          example: 1785727927
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          schema:
            type: integer
          example: 1785814327
        - name: limit
          in: query
          schema:
            type: integer
          example: 100
        - 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: 40116
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 06:03:55 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 1000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 995
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774339435
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  trades:
                    type: array
                    description: Danh sách giao dịch khớp lệnh
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000HPG4
                        symbol: HPG
                        matchPrice: 94.1
                        matchQtty: 10
                        side: BUY
                        avgPrice: 87.872
                        totalVolumeTraded: 12070
                        grossTradeAmount: 10.60617
                        highestPrice: 94.1
                        lowestPrice: 87.6
                        openPrice: 87.6
                        time: '2026-08-04 10:29:51.070'
                    items:
                      type: object
                      properties:
                        marketId:
                          type: string
                          example: STO
                          description: |-
                            Mã thị trường niêm yết mã chứng khoán
                            - DVX: Phái sinh sàn HNX
                            - HCX: Trái phiếu doanh nghiệp HNX
                            - STO: Cổ phiếu sàn HOSE
                            - STX: Cổ phiếu sàn HNX
                            - UPX: Cổ phiếu sàn Upcom
                        boardId:
                          type: string
                          example: G1
                          description: |-
                            Mã bảng giao dịch
                            - G1: Lô chẵn
                            - G4: Lô lẻ
                            - T1: Thỏa thuận trong giờ (9h - 14h45)
                            - T3: Thỏa thuận sau giờ (14h45 - 15h)
                            - T4: Thỏa thuận lô lẻ trong giờ (9h - 14h45)
                            - T6: Thỏa thuận lô lẻ sau giờ (14h45 - 15h)
                        isin:
                          type: string
                          example: VN000000HPG4
                          description: Mã định danh quốc tế (ISIN) của chứng khoán
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        matchPrice:
                          type: number
                          format: double
                          example: 94.1
                          description: Giá khớp gần nhất
                        matchQtty:
                          type: integer
                          format: int32
                          example: 10
                          description: Khối lượng khớp gần nhất
                        side:
                          type: string
                          example: BUY
                          description: >-
                            Chiều giao dịch. Giá trị: BUY (Mu chủ động), SELL
                            (Bán chủ động), UNSPECIFIED (Không xác định)
                        avgPrice:
                          type: number
                          format: double
                          example: 87.872
                          description: Giá khớp trung bình
                        totalVolumeTraded:
                          type: integer
                          format: int32
                          example: 12070
                          description: Tổng khối lượng giao dịch trong ngày
                        grossTradeAmount:
                          type: number
                          format: double
                          example: 10.60617
                          description: Tổng giá trị giao dịch trong ngày
                        highestPrice:
                          type: number
                          format: double
                          example: 94.1
                          description: Giá cao nhất trong ngày
                        lowestPrice:
                          type: number
                          format: double
                          example: 87.6
                          description: Giá thấp nhất trong ngày
                        openPrice:
                          type: number
                          format: double
                          example: 87.6
                          description: Giá mở cửa
                        time:
                          type: string
                          example: '2026-08-04 10:29:51.070'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7)
                  nextPageToken:
                    type: string
                    example: NTkzMDgyMThfMjAyNi0wOC0wNFQwMjoxNjozNy4zNlo=
                    description: >-
                      Token dùng để lấy trang dữ liệu tiếp theo. Không có hoặc
                      rỗng nếu không còn dữ liệu
              example:
                trades:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 30
                    side: BUY
                    avgPrice: 87.876
                    totalVolumeTraded: 12160
                    grossTradeAmount: 10.68574
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:19:39.855'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 20
                    side: BUY
                    avgPrice: 87.877
                    totalVolumeTraded: 12130
                    grossTradeAmount: 10.65946
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:19:39.854'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 10
                    side: SELL
                    avgPrice: 87.877
                    totalVolumeTraded: 12110
                    grossTradeAmount: 10.64194
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:01:41.729'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 88
                    matchQtty: 20
                    side: SELL
                    avgPrice: 87.878
                    totalVolumeTraded: 12100
                    grossTradeAmount: 10.63318
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:01:41.729'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: UNSPECIFIED
                    avgPrice: 87.877
                    totalVolumeTraded: 12080
                    grossTradeAmount: 10.61558
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 10:50:52.615'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.872
                    totalVolumeTraded: 12070
                    grossTradeAmount: 10.60617
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 10:29:51.070'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 100
                    side: BUY
                    avgPrice: 87.867
                    totalVolumeTraded: 12060
                    grossTradeAmount: 10.59676
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:53:37.234'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.815
                    totalVolumeTraded: 11960
                    grossTradeAmount: 10.50266
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:52:40.863'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 100
                    side: BUY
                    avgPrice: 87.81
                    totalVolumeTraded: 11950
                    grossTradeAmount: 10.49325
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:45:50.879'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 88
                    matchQtty: 10
                    side: SELL
                    avgPrice: 87.757
                    totalVolumeTraded: 11850
                    grossTradeAmount: 10.39915
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:45:27.028'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 20
                    side: BUY
                    avgPrice: 87.756
                    totalVolumeTraded: 11840
                    grossTradeAmount: 10.39035
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:43:20.216'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.746
                    totalVolumeTraded: 11820
                    grossTradeAmount: 10.37153
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:43:16.440'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.74
                    totalVolumeTraded: 11810
                    grossTradeAmount: 10.36212
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:42:12.070'
                nextPageToken: null
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              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.