About this project

This repository provides sample code and auxiliary tools for integrating Korea Investment & Securities' KIS Open API. examples_user provides functions and execution examples consolidated by product, while examples_llm states that it separates minimal call files and verification files for each single API function so that LLM code agents can explore them easily. The common kis_auth.py handles issuance and management of access tokens, switching between live and mock environments, common API calls, and WebSocket connection settings. The API categories covered are authentication, domestic stocks, domestic bonds, domestic futures options, overseas stocks, overseas futures options, ELW, and ETF/ETN. Along with REST examples, there are also examples of subscribing to real-time quotes via WebSocket. To use it, you must apply for the KIS Open API and then set the app key, app secret, HTS ID, and account number in kis_devlp.yaml; Python 3.11 or higher and use of uv are recommended. As additional tools, strategy_builder designs trading strategies through a visual UI and generates BUY/SELL/HOLD signals, and supports 80 technical indicators and 10 preset strategies. backtester provides historical data verification, parameter optimization, and HTML reports using Docker-based QuantConnect Lean, and strategies are shared in .kis.yaml format. The MCP directory covers AI tool connections through KIS Code Assistant and Trading MCP. Using the strategy tools may require Node.js 18+ and Docker Desktop. The provider states that the sample code is for reference, that the code may be updated without separate notice, and that it is not responsible for damages caused by programs that use it.