Kiwoom REST API
Python client for interacting with Kiwoom REST API.
Table of Contents
Installation
using pip
pip install kiwoom-rest-api
using uv
uv add kiwoom-rest-api
using poetry
poetry add kiwoom-rest-api
Usage
import os
os.environ["KIWOOM_API_KEY"] = "your_api_key"
os.environ["KIWOOM_API_SECRET"] = "your_api_secret"
from kiwoom_rest_api.koreanstock.stockinfo import StockInfo
from kiwoom_rest_api.auth.token import TokenManager
# 토큰 매니저 초기화
token_manager = TokenManager()
# StockInfo 인스턴스 생성 (base_url 수정)
stock_info = StockInfo(base_url="https://api.kiwoom.com", token_manager=token_manager)
try:
result = stock_info.basic_stock_information_request_ka10001("005930")
print("API 응답:", result)
except Exception as e:
print("에러 발생:", str(e))
CLI Usage
Using uvx
uvx --from kiwoom-rest-api kiwoom -k "YOUR_KEY" -s "YOUR_SECRET" ka10001 005930
Set API Key
# Linux/macOS/Windows(git bash)
export KIWOOM_API_KEY="YOUR_ACTUAL_API_KEY"
export KIWOOM_API_SECRET="YOUR_ACTUAL_API_SECRET"
# Windows (CMD)
set KIWOOM_API_KEY="YOUR_ACTUAL_API_KEY"
set KIWOOM_API_SECRET="YOUR_ACTUAL_API_SECRET"
# Windows (PowerShell)
$env:KIWOOM_API_KEY="YOUR_ACTUAL_API_KEY"
$env:KIWOOM_API_SECRET="YOUR_ACTUAL_API_SECRET"
# 가상 환경 활성화 (필요시)
poetry shell
# 도움말 보기
kiwoom --help
kiwoom ka10001 --help
# ka10001 명령어 실행 (환경 변수 사용 시)
kiwoom ka10001 005930 # 삼성전자 예시
# ka10001 명령어 실행 (옵션 사용 시)
kiwoom --api-key "YOUR_KEY" --api-secret "YOUR_SECRET" ka10001 005930
# 다른 base URL 사용 시
kiwoom --base-url "https://mockapi.kiwoom.com" ka10001 005930
Docs
License
This project is licensed under the terms of the MIT license.
Release files for kiwoom-rest-api 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kiwoom_rest_api-0.1.12.tar.gz | 57.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kiwoom_rest_api-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 129.2 kB
Release files / kiwoom_rest_api-0.1.12.tar.gz
| Download URL | kiwoom_rest_api-0.1.12.tar.gz |
|---|---|
| Size | 57.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0442d20819be7d580e58e75f64abd3b6dc7987130ac225d314dfee38dd1a33c
|
|
BLAKE2b-256 checksum How to use checksums |
31374d64bacd086bff1fd03922a7f33de5a0922a583a4dd7e284d68cd971b863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.1 Windows/11
|
Release files / kiwoom_rest_api-0.1.12-py3-none-any.whl
| Download URL | kiwoom_rest_api-0.1.12-py3-none-any.whl |
|---|---|
| Size | 72.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a83fdc091b82e4562434f9423cd8b27eba6bbc0b615701b88db135ebed0004c8
|
|
BLAKE2b-256 checksum How to use checksums |
79a21a503ff0a5916d0aede826881d3ba6ff6abb7f7384953208caf4d283b7a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.1 Windows/11
|