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

# Dữ liệu OHLCV

> Lấy dữ liệu nến OHLCV theo khoảng thời gian. Thời gian cung cấp 1 năm gần nhất cho dữ liệu intraday, dữ liệu daily cung cấp từ khi mã chứng khoán được giao dịch.



## OpenAPI

````yaml /vi/openapi/ssi.openapi.yaml get /api/v3/data/ohlc
openapi: 3.1.2
info:
  title: SSI FastConnect Open API
  version: 3.0.0
servers:
  - url: https://api.ssi.com.vn
    description: Production
security:
  - SsiBearerAuth: []
tags:
  - name: authentication
    description: Xác thực và quản lý token.
    x-group: Xác thực
  - name: account
    description: Thông tin tài khoản giao dịch.
    x-group: Tài khoản
  - name: market-data
    description: Dữ liệu thị trường.
    x-group: Dữ liệu thị trường
  - name: trading
    description: Giao dịch và quản lý lệnh.
    x-group: Giao dịch
  - name: conditional-orders
    description: Lệnh điều kiện.
    x-group: Lệnh điều kiện
paths:
  /api/v3/data/ohlc:
    get:
      tags:
        - market-data
      summary: Dữ liệu OHLCV
      description: >-
        Lấy dữ liệu nến OHLCV theo khoảng thời gian. Thời gian cung cấp 1 năm
        gần nhất cho dữ liệu intraday, dữ liệu daily cung cấp từ khi mã chứng
        khoán được giao dịch.
      operationId: getOhlc
      parameters:
        - name: symbol
          in: query
          description: Mã chứng khoán cần lấy dữ liệu OHLCV.
          required: true
          schema:
            type: string
        - name: from
          in: query
          description: >-
            Mốc thời gian bắt đầu. Định dạng `YYYY/MM/DD` cho dữ liệu daily và
            `YYYY/MM/DD HH:mm:ss` cho dữ liệu intraday.
          required: true
          schema:
            type: string
        - name: to
          in: query
          description: >-
            Mốc thời gian kết thúc. Định dạng `YYYY/MM/DD` cho dữ liệu daily và
            `YYYY/MM/DD HH:mm:ss` cho dữ liệu intraday.
          required: true
          schema:
            type: string
        - name: timeFrame
          in: query
          description: >-
            Khung thời gian của dữ liệu OHLCV. Giá trị có thể là `1m`, `3m`,
            `5m`, `15m`, `30m`, `1h`, hoặc `1d`. Nếu không cung cấp thì hệ thống
            sẽ sử dụng giá trị mặc định là `1d`.
          required: false
          schema:
            type: string
        - name: pageIndex
          in: query
          description: >-
            Chỉ số trang khi phân trang kết quả, bắt đầu từ 1. Nếu không cung
            cấp thì hệ thống sẽ sử dụng giá trị mặc định là 1.
          required: false
          schema:
            type: integer
        - name: pageSize
          in: query
          description: >-
            Số lượng bản ghi trên mỗi trang. Nếu không cung cấp thì hệ thống sẽ
            sử dụng giá trị mặc định là 10.
          required: false
          schema:
            type: integer
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/UserAgent'
        - $ref: '#/components/parameters/AcceptLanguage'
      responses:
        '200':
          description: Thành công.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OhlcResponse'
              example:
                pageSize: 2
                pageIndex: 1
                data:
                  - symbol: SSI
                    tradingDate: 2026/03/27
                    open: '21061.555'
                    high: '21740.96'
                    low: '21061.555'
                    close: '21621.065'
                    volume: '23305300'
                    value: '503885406144.5'
                  - symbol: SSI
                    tradingDate: 2026/03/26
                    open: '21461.205'
                    high: '21461.205'
                    low: '21061.555'
                    close: '21061.555'
                    volume: '23402600'
                    value: '492895147043'
                code: 200
                msg: ''
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - SsiBearerAuth: []
components:
  parameters:
    ContentType:
      name: Content-Type
      in: header
      required: true
      description: Định dạng nội dung request body. Chủ yếu là application/json.
      schema:
        type: string
        default: application/json
    UserAgent:
      name: User-Agent
      in: header
      required: false
      description: Thông tin client gửi request.
      schema:
        type: string
    AcceptLanguage:
      name: Accept-Language
      in: header
      required: false
      description: >-
        Ngôn ngữ phản hồi mong muốn. Nếu không có header này, hệ thống sẽ mặc
        định là en
      schema:
        type: string
        default: en
  schemas:
    OhlcResponse:
      type: object
      properties:
        code:
          description: Mã kết quả.
          type: integer
        msg:
          description: Thông báo kết quả.
          type: string
        pageSize:
          description: Số lượng bản ghi trên mỗi trang.
          type: integer
        pageIndex:
          description: Chỉ số trang.
          type: integer
        data:
          description: Dữ liệu trả về.
          type: array
          items:
            type: object
            properties:
              symbol:
                description: Mã chứng khoán hoặc mã hợp đồng phái sinh.
                type: string
              tradingDate:
                description: Ngày giao dịch.
                type: string
              open:
                description: Giá mở cửa.
                type: string
              high:
                description: Giá cao nhất.
                type: string
              low:
                description: Giá thấp nhất.
                type: string
              close:
                description: Giá đóng cửa.
                type: string
              volume:
                description: Khối lượng giao dịch.
                type: string
              value:
                description: Giá trị giao dịch.
                type: string
    ErrorResponse:
      type: object
      properties:
        code:
          description: Mã kết quả hoặc mã xác thực giao dịch.
          type: string
        msg:
          description: Thông báo kết quả xử lý.
          type: string
  responses:
    BadRequest:
      description: Yêu cầu không hợp lệ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Chưa được xác thực hoặc token không hợp lệ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Lỗi nội bộ máy chủ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    SsiBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token lấy từ endpoint /api/v3/auth/token hoặc
        /api/v3/auth/refresh.

````

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