pykrx
KRX data scraping
What it is and what it does
PyKrx is a Python library that scrapes stock and bond market data from Korea's KRX (Korean Exchange) and Naver financial services. It retrieves ticker lists, OHLCV (open-high-low-close-volume) data, price changes, and fundamental metrics like PER, EPS, and DIV for stocks across KOSPI, KOSDAQ, and KONEX markets. Data is returned as pandas DataFrames, making it suitable for analysis and backtesting workflows.
The library requires Python 3.10 or later and depends on requests, pandas, numpy, deprecated, multipledispatch, and matplotlib. Some APIs require KRX member credentials (KRX_ID and KRX_PW environment variables). The package includes explicit disclaimers that scraped data is for reference only, carries no warranty, and users bear full responsibility for investment decisions or legal compliance when using the data commercially.
Use it for:
- Backtest trading strategies using historical OHLCV data for Korean stocks across multiple markets
- Build a stock screener that filters Korean equities by fundamentals like PER, EPS, or dividend yield
- Analyze price movements and volatility for Korean bonds and stocks over custom date ranges
- Populate a local database with daily market snapshots for portfolio tracking or research
- Fetch current ticker lists and company names to cross-reference with external data sources
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Scrapes Korean stock and bond market data from KRX and Naver, returning OHLCV, ticker lists, fundamentals, and price changes as pandas DataFrames.
Yes, if you need Korean market data for research, backtesting, or portfolio analysis. The library is actively maintained, has low install friction, and carries a permissive MIT license. Be aware that it scrapes third-party data (KRX and Naver), so respect rate limits, verify data accuracy against official sources, and comply with terms of service for commercial use. Authentication is required for some APIs.
Install
pykrx on PyPI
pip
pip install pykrxuv
uv add pykrxpoetry
poetry add pykrxInstalling pykrx
Before you install
Low install friction with a pure-Python wheel and common dependencies. Active maintenance with recent commits and 1078 repository stars. Supports Python 3.10 through 3.14.
License in practice
MIT license permits commercial use, modification, and redistribution with attribution. No restrictions on using this package in proprietary projects.
Quickstart
pip install pykrx
from pykrx import stock
tickers = stock.get_market_ticker_list("20190225")
df = stock.get_market_ohlcv("20220720", "20220810", "005930")
KRX_ID and KRX_PW environment variables must be set to access authenticated KRX APIs; some functions work without them but authentication-required data will fail.
Verify before relying
- Whether rate-limiting or request throttling is enforced by the library itself or must be managed by the caller
- Scope and completeness of bond module APIs relative to stock module
- Real-time data availability versus delayed/historical data only
- Whether matplotlib is used for plotting or is an optional visualization dependency
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — requests, pandas, numpy, deprecated, multipledispatch, matplotlib |
| Maintenance | actively maintained — 102 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 414,414/month — #6,833 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pykrx-1.2.8-py3-none-any.whl
Keywords: KRX, stock, bond, financial, data, scraping
Tags
More WWW/HTTP 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
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
finance-datareaderFetches historical and current financial…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
vnstockVnstock fetches Vietnamese stock market…
noncommercial · top 15,000 on PyPI
tushareFetches historical and real-time Chinese stock…
permissive · top 15,000 on PyPI
finvizfinanceScrapes financial data from FinViz website,…
permissive · top 15,000 on PyPI
baostockBaoStock retrieves historical China stock…
permissive · top 15,000 on PyPI
stockstatsAdds technical analysis indicators and…
permissive · top 15,000 on PyPI
akshareAKShare fetches financial market data (stocks,…
permissive · top 5,000 on PyPI
databentoOfficial Python client for accessing live and…
permissive · top 5,000 on PyPI