skillfed

pykrx

KRX data scraping

pykrx v1.2.8 414.4K downloads/30d#6,833 on PyPI1,078
Permissive license MIT Active released

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 pykrx

uv

uv add pykrx

poetry

poetry add pykrx

Installing 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

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

Tags

korean stock market dataKRX scrapingOHLCV data koreastock ticker koreafinancial data scrapingkorean bond datamarket fundamentals korea
korean-marketsfinancial-dataweb-scraping

More WWW/HTTP packages