Skip to main content

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

pypi github

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)

Source distribution for kiwoom-rest-api 0.1.12
File Size Uploaded
kiwoom_rest_api-0.1.12.tar.gz 57.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kiwoom-rest-api 0.1.12
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page