Search for Symbols

Finding the ticker symbol, security identifier, the sector, and other metadata is easy if you know where to look. This guide is intended to introduce some methods for searching, screening, and discovery.

Find a Company

Leave the symbol parameter empty to get the full list of companies available from a provider. Default provider of this command is ssi.

[1]:
from vietfin import vf

vf.equity.search()
Retrieved 1610 records for equity.search() from SSI.
[1]:
VfObject

results: [{'symbol': 'VVS', 'name': 'Công ty Cổ phần Đầu tư Phát triển Máy Việt Nam...
provider: ssi
extra: {'command_run_at': '2024-02-27T01:06:42.314412+00:00', 'symbol': '', 'record...
raw_data: {'page': 1, 'pageSize': 0, 'totalCount': 1610, 'items': [{'organCode': '0...

Apply the to_df() method to view the output as a pandas dataframe.

[2]:
vf.equity.search().to_df().head(5)
Retrieved 1610 records for equity.search() from SSI.
[2]:
symbol name short_name code
0 VVS Công ty Cổ phần Đầu tư Phát triển Máy Việt Nam Đầu tư Phát triển Máy Việt Nam 0104498100
1 VMK Công ty Cổ Phần Vimarko Vimarko 0108720772
2 HIO Công ty Cổ Phần Helio Energy Helio Energy 0109204756
3 SBG Công ty Cổ Phần Tập Đoàn Cơ Khí Công Nghệ Cao ... Tập Đoàn Cơ Khí Công Nghệ Cao Siba 0313140100
4 THM Công ty Cổ phần Tứ Hải Hà Nam Tứ Hải Hà Nam 0700519785

Now try to retrieve the full list from another provider.

[3]:
vf.equity.search(provider="wifeed")
Retrieved 1751 records from WiFeed.
[3]:
VfObject

results: [{'symbol': 'A32', 'name': 'CTCP 32', 'exchange': 'UPCOM'}, {'symbol': 'AA...
provider: wifeed
extra: {'command_run_at': '2024-02-24T02:56:22.892455+00:00', 'symbol': '', 'record...
raw_data: {'data': [{'code': 'A32', 'fullname_vi': 'CTCP 32', 'loaidn': 1, 'san': '...

We can also search for a specific stock ticker.

[4]:
vf.equity.search(symbol="stb")
Retrieved 1 records for equity.search() from SSI.
[4]:
VfObject

results: [{'symbol': 'STB', 'name': 'Ngân hàng Thương mại Cổ phần Sài Gòn Thương Tí...
provider: ssi
extra: {'command_run_at': '2024-02-24T02:58:37.402959+00:00', 'symbol': 'STB', 'rec...
raw_data: {'page': 1, 'pageSize': 0, 'totalCount': 1610, 'items': [{'organCode': '0...

Find an Index

Get the list of all available indices from a provider. Default provider is ssi.

[2]:
vf.index.search().to_df().head(5)
Retrieved 25 records.
[2]:
index_symbol group_by_index
0 HNX30 HNXIndex
1 HNXIndex HNXIndex
2 UpcomIndex UpcomIndex
3 VN100 VNINDEX
4 VN30 VNINDEX

Get the list of the constituent companies in the index.

[3]:
vf.index.constituents(symbol="vn30").to_df().head(5)
Retrieved 30 records.
[3]:
symbol name open high low prev_close exchange
0 ACB Ngân hàng Thương mại Cổ phần Á Châu 0.0 0.0 0.0 27500.0 hose
1 BCM Tổng Công ty Đầu tư và Phát triển Công nghiệp ... 0.0 0.0 0.0 63300.0 hose
2 BID Ngân hàng Thương mại Cổ phần Đầu tư và Phát tr... 0.0 0.0 0.0 53600.0 hose
3 BVH Tập đoàn Bảo Việt 0.0 0.0 0.0 42050.0 hose
4 CTG Ngân hàng Thương mại Cổ phần Công thương Việt Nam 0.0 0.0 0.0 35650.0 hose

We always know which data provider is being used in a command, via the provider attribute of the VfObject class.

[3]:
vf.index.constituents(symbol="vn30").provider
Retrieved 30 records.
[3]:
'ssi'