Vnstock Logo

Tham chiếu

Thử nghiệm

Mục lục

Bản thử nghiệm, chưa phát hành chính thức

Trang này viết cho vnstock v6.0.0rc2, bản thử nghiệm. Tên hàm, tham số và cột dữ liệu có thể còn đổi trước ngày phát hành; khi cài, ghi rõ số phiên bản như ở trang Cài đặt. Bản đang phát hành chính thức là v5.0.1, xem tài liệu bản đó.

Nguồn của bạn

Chọn nguồn bạn có khoá, mã trên trang sẽ điền theo. Chưa chọn thì mã giữ chỗ trống <nguồn>. Nguồn xếp theo bảng chữ cái, không phải khuyến nghị.

Reference dùng để truy xuất dữ liệu tham chiếu: danh sách mã theo sàn và loại tài sản, thành phần rổ chỉ số, ngành, lịch sự kiện, thông tin doanh nghiệp, quỹ mở, phiên và ngày giao dịch.

Cách gọi

Python
from vnstock import Reference

Reference("<nguồn>").equity.list(exchange="HOSE")

Các hàm dưới đây mỗi hàm chỉ có ở một nguồn, nên ví dụ ghi thẳng tên nguồn đó:

Python
from vnstock import Reference

Reference("ssi").index("VN30").members()
Reference("fhsc").company("FPT").info()
Reference("dnse").market.trading_days(start="2026-11-01", end="2026-12-31")
Reference("fmp").search.symbol("AAPL")
Reference().index.groups()                    # bảng có sẵn trong thư viện, không cần nguồn

Nhóm cần mã thì gọi kèm mã: company("FPT"), index("VN30"). Không nêu nguồn thì vnstock dùng quy tắc đặt bằng vnstock.sources (Chọn nguồn).

Reference(...).etf.list(), .bond.list(), .warrant.list() và .futures.list() cùng đọc danh sách mã, sau đó lọc theo loại tài sản trong cột type.

Các tham số chung source, compat, columns dùng như ở Thị trường.

Hàm theo nhóm

Bảng sinh từ thư viện bản 6.0.0.dev0, hồ sơ v5 (mặc định). "Tên khác" là tên của thế hệ 5 cho cùng dữ liệu. Danh sách đầy đủ trên máy bạn: vnstock tools, hoặc show_api() trong Python.

Cổ phiếu (equity)

HàmTên khácTham sốNguồn (source=)
by_group()list_by_groupssi
list()by_exchange, list_by_exchange, list_by_industryexchange, type, groupdnse, ssi
price_limits()date, exchange, boarddnse, ssi
status()boarddnse
Cột trả về (hồ sơ v5, mặc định)
HàmCột
by_group()symbol, index_symbol
list()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size
price_limits()trading_date, symbol, exchange, board, reference_price, ceiling_price, floor_price
status()symbol, board, time, trading_status, admin_status, trading_method_status, sanction_status

Chứng chỉ quỹ ETF (etf)

HàmTên khácTham sốNguồn (source=)
list()exchange, type, groupdnse, ssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
list()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size

Trái phiếu (bond)

HàmTên khácTham sốNguồn (source=)
list()exchange, type, groupdnse, ssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
list()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size

Chỉ số (index)

HàmTên khácTham sốNguồn (source=)
groups()có sẵn, không cần nguồn
info()descriptionssi
list()exchangefhsc, ssi
members()by_group, list_by_groupssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
groups()group_name, group_code, category, description
info()symbol, name, exchange
list()symbol, name, description, full_name, group, index_id, sector_id, exchange
members()symbol, index_symbol

Hợp đồng tương lai (futures)

HàmTên khácTham sốNguồn (source=)
info()tcbs
list()exchange, type, groupdnse, ssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
info()symbol, underlying_symbol, last_trading_date, continuous_symbol, name, listing_date
list()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size

Chứng quyền (warrant)

HàmTên khácTham sốNguồn (source=)
info()ssi
list()exchange, type, groupdnse, ssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
info()symbol, name, isin, issuer, underlying_symbol, exercise_price, exercise_ratio, first_trading_date, last_trading_date, maturity_date, listed_share, exchange, warrant_type
list()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size

Quỹ mở (fund)

HàmTên khácTham sốNguồn (source=)
list()fhsc
nav_report()start, endfhsc
profile()fhsc
Cột trả về (hồ sơ v5, mặc định)
HàmCột
list()ticker, organ_name, fund_type, name, valuation_frequency
nav_report()time, nav
profile()ticker, total_assets, nav, nav_update_at, name

Doanh nghiệp (company)

HàmTên khácTham sốNguồn (source=)
events()start, endfhsc, ssi
info()overviewfhsc
insider_trading()start, endfhsc
ownership()fhsc
shareholders()fhsc
trading_stats()start, end, length, limitssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
events()symbol, event_title, ex_right_date, record_date, payout_date, value, ratio, issue_date, event_type, ratio_text, dividend_percent, exercise_price
info()symbol, name, sector, profile, name_en
insider_trading()id, symbol, person_name, position, transaction_type, registered_volume, traded_volume, start_date, end_date, status, shares_before, shares_after, ownership_percent_before, ownership_percent_after, relation_type, related_person_name
ownership()symbol, owner_type, ownership_percentage, shares_owned
shareholders()symbol, name, shareholder_type, total_shares, rate, date
trading_stats()symbol, time, average_match_volume, average_match_value, average_deal_volume, average_deal_value, average_volume, average_value, total_match_volume, total_match_value, total_deal_volume, total_deal_value, total_volume, total_value, fr_buy_volume_total, fr_buy_value_total, fr_sell_volume_total, fr_sell_value_total, fr_net_volume_total, fr_net_value_total, fr_buy_volume_total_avg, fr_buy_value_total_avg, fr_sell_volume_total_avg, fr_sell_value_total_avg, fr_net_volume_total_avg, fr_net_value_total_avg, total_buy_trade_volume, total_sell_trade_volume, total_buy_trade_volume_avg, total_sell_trade_volume_avg, total_buy_trade, total_sell_trade, total_buy_trade_avg, total_sell_trade_avg, total_net_trade_volume, total_net_trade_volume_avg, average_buy_volume_per_trade, average_sell_volume_per_trade, close_price, reference_price

Sự kiện doanh nghiệp (events)

HàmTên khácTham sốNguồn (source=)
calendar()start, endfhsc, ssi
market()exchangefmp
Cột trả về (hồ sơ v5, mặc định)
HàmCột
calendar()symbol, event_title, ex_right_date, record_date, payout_date, value, ratio, issue_date, event_type, ratio_text, dividend_percent, exercise_price
market()date, event_name, venue, is_closed

Ngành (industry)

HàmTên khácTham sốNguồn (source=)
list()ssi
sectors()exchange, type, groupdnse, ssi
Cột trả về (hồ sơ v5, mặc định)
HàmCột
list()icb_code, icb_name, icb_level
sectors()symbol, exchange, type, organ_name, organ_short_name, icb_code, icb_name, name_en, listing_date, listed_shares, lot_size

Phiên và ngày giao dịch (market)

HàmTên khácTham sốNguồn (source=)
sessions()exchange, boarddnse
status()fhsc
trading_days()start, enddnse
Cột trả về (hồ sơ v5, mặc định)
HàmCột
sessions()exchange, board, product_group, session_id, event, time
status()exchange, status, timestamp, last_trading_date
trading_days()trading_date
HàmTên khácTham sốNguồn (source=)
symbol()infolimitfmp
Cột trả về (hồ sơ v5, mặc định)
HàmCột
symbol()symbol, name, exchange, currency

Chưa hỗ trợ

Hàm thế hệ 5 chưa có nguồn đọc được ở thế hệ 6 báo CompatibilityWarning rồi UnsupportedError mã VNSTOCK_ROUTE_UNSUPPORTED. Hàm đã ngừng từ thế hệ 5 báo VNSTOCK_ROUTE_REMOVED.

Reference("<nguồn>").equity.list(group="VN30") lọc danh sách theo rổ ngay ở nguồn, với nguồn hỗ trợ lọc theo rổ (dnse không lọc được theo rổ và báo lỗi). Các hàm nhóm nhận mã theo vị trí như thế hệ 5 (Reference().fund.profile("DCDS")), theo tên (symbol="DCDS"), hoặc gọi kèm mã: Reference().index("VN30").members().