vnstock
A beginner-friendly yet powerful Python toolkit for financial analysis and automation — built to make modern investing accessible to everyone
What it is and what it does
Vnstock is a Python library that automates extraction of Vietnamese stock market data through a unified API. It provides access to equity prices (OHLCV), financial statements, company profiles, market indices, derivatives, ETFs, and macroeconomic indicators—all returned as pandas DataFrames ready for analysis or export. The library abstracts away the complexity of scraping fragmented Vietnamese market data sources, letting you focus on building quantitative models, integrating analysis platforms, or exploring historical price trends.
The package is designed for individual investors and developers who want programmatic access to Vietnamese market data without writing custom scrapers. It supports modern Python versions (3.10+), integrates with pandas and seaborn for analysis and visualization, and is built to work with AI agents and "vibe coding" workflows. Rate limiting is enforced (20–600 requests per minute depending on registration tier), and authentication is optional for basic use but recommended for higher throughput.
Use it for:
- Fetch historical OHLCV data for a Vietnamese stock symbol to backtest a trading strategy or calculate technical indicators.
- Retrieve company financial statements (balance sheet, income statement) to build a fundamental analysis dashboard.
- List all equities in a specific industry or exchange board to screen for investment opportunities.
- Export market index constituents and their real-time quotes for portfolio tracking or rebalancing.
- Integrate Vietnamese market data into a quantitative research pipeline or AI-driven analysis workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Vnstock fetches Vietnamese stock market data—historical prices, financial statements, company profiles, indices, and macroeconomic indicators—via a unified Python API and returns it as pandas DataFrames.
Yes—if your use case is personal research, education, or non-commercial analysis of Vietnamese markets. The library has low install friction, active maintenance, no known vulnerabilities, and a large API surface covering equities, indices, fundamentals, and macroeconomic data. However, verify the custom noncommercial license against your intended use; commercial applications require explicit permission. Rate limiting and API key registration may be necessary for production workloads.
Install
vnstock on PyPI
pip
pip install vnstockuv
uv add vnstockpoetry
poetry add vnstockInstalling vnstock
Before you install
Low friction: pure Python wheel, 13 runtime dependencies (requests, pandas, beautifulsoup4, seaborn, openpyxl, pydantic, and others) are all stable and widely available. Active maintenance—last commit 2026-07-24, 1373 GitHub stars, released 21 days ago.
License in practice
Custom noncommercial license: free for personal research and non-commercial use; commercial applications require contacting support@vnstocks.com. Verify your intended use case against the license terms before deploying.
Quickstart
pip install -U vnstock
from vnstock import Market, Reference
market = Market()
df_history = market.equity.ohlcv(symbol='VNM', start='2024-01-01', end='2024-05-01')
ref = Reference()
df_profile = ref.company.info(symbol='FPT')
Requires Python >=3.10. API calls are rate-limited: 20 requests/minute as guest, 60 requests/minute with free registration, higher tiers available via sponsorship.
Verify before relying
- Whether the 1.2 million lifetime downloads claim is current as of the fact sheet date.
- Data freshness guarantees and real-time vs. delayed pricing for equity quotes.
- Availability and completeness of historical data for all supported symbols and date ranges.
- Whether vnai and vnstock_ezchart dependencies are optional or required for core functionality.
Package facts
| License | Custom: Personal, research, non-commercial; contact support@vnstocks.com for other use (noncommercial) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — requests, beautifulsoup4, pandas, seaborn, openpyxl, pydantic, psutil, packaging, importlib-metadata, tenacity, vnai, vnstock_ezchart, pytz |
| Maintenance | actively maintained — 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,773/month — #12,786 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vnstock-4.0.5-py3-none-any.whl
Keywords: vnstock, finance, vietnam, stock market, analysis, API
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyviProvides Vietnamese language processing tools…
permissive · top 15,000 on PyPI
vnaiVnAI provides a Python interface for accessing…
unclear · top 15,000 on PyPI
vnstock-ezchartGenerates publication-quality static financial…
permissive · top 15,000 on PyPI
pykrxScrapes Korean stock and bond market data from…
permissive · top 15,000 on PyPI
lseg-dataClient library for accessing LSEG Data Platform…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
baostockBaoStock retrieves historical China stock…
permissive · top 15,000 on PyPI
tushareFetches historical and real-time Chinese stock…
permissive · top 15,000 on PyPI
tradingeconomicsProvides Python access to over 300,000 economic…
permissive · top 15,000 on PyPI
sea-g2pConverts text to phonemes for Vietnamese, Thai,…
permissive · top 15,000 on PyPI