pykrx
KRX data scraping
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- Low install friction with a pure-Python wheel and common dependencies.
- Active maintenance with recent commits and 1078 repository stars.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial use, modification, and redistribution with attribution. No restrictions on using this package in proprietary projects.
last release 2026-05-04 (102 days) · last repo commit 2026-05-04 · 1,078 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 414,414 downloads/mo, #6,833 on PyPI
Alternatives
Verify before relying
pip install pykrx
from pykrx import stock
tickers = stock.get_market_ticker_list("20190225")
df = stock.get_market_ohlcv("20220720", "20220810", "005930")- 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
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 on it.
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
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.
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.
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")
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 packagesrequestspandasnumpydeprecatedmultipledispatchmatplotlib |
| 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 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: pykrx-1.2.8-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “korean stock market data”
- pykrxScrapes Korean stock and bond market data from KRX and Naver,…
- finance-datareaderFetches historical and current financial data—stock prices, indices,…
- baostockBaoStock retrieves historical China stock market data and returns it…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also finance-datareader · yahooquery · yfinance · vnstock · tushare · finvizfinance · baostock · stockstats · akshare · databento