Skip to main content

Kiwoom REST API client for Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kiwoom_rest_api-0.1.12.tar.gz (57.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kiwoom_rest_api-0.1.12-py3-none-any.whl (72.0 kB view details)

Uploaded Python 3

File details

Details for the file kiwoom_rest_api-0.1.12.tar.gz.

File metadata

  • Download URL: kiwoom_rest_api-0.1.12.tar.gz
  • Upload date:
  • Size: 57.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Windows/11

File hashes

Hashes for kiwoom_rest_api-0.1.12.tar.gz
Algorithm Hash digest
SHA256 d0442d20819be7d580e58e75f64abd3b6dc7987130ac225d314dfee38dd1a33c
MD5 34d652e96ac7be313c2b9293985c1c9a
BLAKE2b-256 31374d64bacd086bff1fd03922a7f33de5a0922a583a4dd7e284d68cd971b863

See more details on using hashes here.

File details

Details for the file kiwoom_rest_api-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: kiwoom_rest_api-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 72.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Windows/11

File hashes

Hashes for kiwoom_rest_api-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a83fdc091b82e4562434f9423cd8b27eba6bbc0b615701b88db135ebed0004c8
MD5 a86f9a11cb4da2db2d91c61793614f5f
BLAKE2b-256 79a21a503ff0a5916d0aede826881d3ba6ff6abb7f7384953208caf4d283b7a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page