vnstock-js

vnstock-js

Tài LiệuVí DụBài ViếtTài Chính
k

© Copyright 2026

Giới Thiệu
Danh Sách Hàm
Cài Đặt
Kiến Trúc
Hướng Dẫn Sử Dụng Nhanh
CLI
Lịch Sử Phiên Bản
Câu Hỏi Thường Gặp
Cơ Bản
QuoteHistory
PriceBoardItem
TopStock
CompanyProfile
ScreenResult
RealtimeQuote
ExchangeRate
  1. Tài Liệu
  2. Getting Started
  3. Quick Start Guide

Hướng Dẫn Sử Dụng Nhanh

Bắt đầu nhanh với vnstock-js

Cơ bản

import { stock, commodity } from 'vnstock-js';

// Dữ liệu giá cổ phiếu VCI từ 01-01-2024
const prices = await stock.quote({ ticker: 'VCI', start: '2024-01-01' });
// → [{ date: "2024-01-02", open: 25.5, high: 26.0, low: 25.0, close: 25.8, volume: 1000000 }, ...]

// Dữ liệu chỉ số VNINDEX
const index = await stock.index({ index: 'VNINDEX', start: '2024-01-01' });

// Top tăng/giảm
const gainers = await stock.topGainers();
const losers = await stock.topLosers();

// Thông tin công ty
const company = stock.company({ ticker: 'VCI' });
const profile = await company.profile();
const shareholders = await company.shareholders();

// Dữ liệu vàng
const goldPrices = await commodity.gold.priceSJC();

Nâng cao

import vnstock, { sma, rsi } from 'vnstock-js';

// Dữ liệu giá với nhiều tùy chọn
const history = await vnstock.stock.quote.history({
  symbols: ['VCI'],
  start: '2024-01-01',
  end: '2024-06-30',
  timeFrame: '1D'
});

// Tính chỉ báo kỹ thuật
const sma20 = sma(history, { period: 20 });
const rsi14 = rsi(history);

// Sàng lọc cổ phiếu
const screened = await vnstock.stock.screening.screen({
  exchange: 'HOSE',
  filters: [
    { field: 'pe', operator: '<', value: 15 },
    { field: 'roe', operator: '>', value: 0.15 },
  ],
  sortBy: 'marketCap',
  order: 'desc',
  limit: 10,
});
PreviousKiến Trúc
NextCLI

Nội Dung

Cơ bảnNâng cao