Stripe MCP
Stripe’s official server lets AI view and manage customers, products, payments and invoices. Connect to Stripe’s cloud and sign in with OAuth.
Korean stocks via the Kiwoom REST API: quotes, charts, rankings, account. Live orders opt-in only.
Lists are ordered by a usage score (out of 100) built from these parts
| Popularity | 6/80 | GitHub stars or weekly downloads: the larger counts 60, the smaller 20 |
|---|---|---|
| Freshness | 12/12 | Full marks for a release or code change within 30 days |
| Still answering | 0/8 | The cloud endpoint answered at the last check |
| Usage score | 18/100 |
Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)
Pick the AI app you use, then copy the settings.
Let your AI install it with one sentence
Please install Kiwoom Securities (키움증권) REST API. Follow https://mcp.popnx.com/i/younghwan91-kiwoom-client.md, show me the commands and wait for my OK before running them.Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads
Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 21, 2026
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server Kiwoom Securities (키움증권) REST API for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "kiwoom-client": { "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
uv --versionMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version
Install once; it works for everything that needs uv
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
SettingsDeveloperEdit Config
{
"mcpServers": {
"kiwoom-client": {
"command": "uvx",
"args": [
"kiwoom-client"
],
"env": {
"KIWOOM_APP_KEY": "your-value",
"KIWOOM_APP_SECRET": "your-value"
}
}
}
}Paste the key only into the app’s field, never into a chat or to anyone
Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing✓ If Claude says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default trueKIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect Kiwoom Securities (키움증권) REST API yet
Kiwoom Securities (키움증권) REST API runs on your computer, but ChatGPT can only connect servers that run on the web
A · Use an app that can connect Kiwoom Securities (키움증권) REST API
B · Others in Online shops & payments that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
Works with Claude Code, with some setup first
You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server Kiwoom Securities (키움증권) REST API for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-client 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
uv --versionMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version
Install once; it works for everything that needs uv
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
Mac: press Command+Space and type Terminal · Windows: open PowerShell
claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-clientReplace “your-value” with your key before pressing Enter
Paste the key only into the app’s field, never into a chat or to anyone
You should see Kiwoom Securities (키움증권) REST API listed as connected
Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default trueKIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server Kiwoom Securities (키움증권) REST API for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "kiwoom-client": { "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
uv --versionMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version
Install once; it works for everything that needs uv
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
In the Kiwoom Securities (키움증권) REST API settings, KIWOOM_APP_KEY, KIWOOM_APP_SECRET is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing✓ If Cursor says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default trueKIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.Descriptions are as written by the maker.
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
You need a Kiwoom Securities (키움증권) REST API key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server Kiwoom Securities (키움증권) REST API for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "kiwoom-client": { "type": "stdio", "command": "uvx", "args": [ "kiwoom-client" ], "env": { "KIWOOM_APP_KEY": "your-value", "KIWOOM_APP_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For KIWOOM_APP_KEY, KIWOOM_APP_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Kiwoom Securities (키움증권) REST API tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
uv --versionMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version
Install once; it works for everything that needs uv
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
In the Kiwoom Securities (키움증권) REST API settings, KIWOOM_APP_KEY, KIWOOM_APP_SECRET is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Use Kiwoom Securities (키움증권) REST API and tell me what you can do for me, then show me one thing✓ If VS Code says it is using Kiwoom Securities (키움증권) REST API or shows a Kiwoom Securities (키움증권) REST API tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
KIWOOM_IS_MOCK true = paper trading server (모의투자). Default false = live server. · default trueKIWOOM_MCP_TOOLSETS Comma-separated modules to expose, e.g. market,chart,account. Default: all.KIWOOM_MCP_MODE discovery = expose only search_tools/describe_tool/call_tool to save context.Descriptions are as written by the maker.
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Claude Code
claude mcp add --scope user kiwoom-client --env KIWOOM_APP_KEY=your-value --env KIWOOM_APP_SECRET=your-value -- uvx kiwoom-clientClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"kiwoom-client": {
"command": "uvx",
"args": [
"kiwoom-client"
],
"env": {
"KIWOOM_APP_KEY": "your-value",
"KIWOOM_APP_SECRET": "your-value"
}
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"kiwoom-client": {
"command": "uvx",
"args": [
"kiwoom-client"
],
"env": {
"KIWOOM_APP_KEY": "your-value",
"KIWOOM_APP_SECRET": "your-value"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"kiwoom-client": {
"type": "stdio",
"command": "uvx",
"args": [
"kiwoom-client"
],
"env": {
"KIWOOM_APP_KEY": "your-value",
"KIWOOM_APP_SECRET": "your-value"
}
}
}
}KIWOOM_APP_KEY secret required envKIWOOM_APP_SECRET secret required envKIWOOM_IS_MOCK envKIWOOM_MCP_TOOLSETS envKIWOOM_MCP_MODE envDescriptions are as written by the maker.
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
pypi: kiwoom-clientBased on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Runs on your computer; the tool list appears in your AI app after you install it.
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 21, 2026
The registry name was verified with the GitHub account younghwan91, which owns the repo
Code last changed today
Uses MIT
This one runs on your computer; there is no internet endpoint
Runs on your computer and uses local settings instead
Runs on your computer; we can only read tool lists from internet endpoints
No entries on OSV.dev for kiwoom-client@0.5.0
Checks only this package version, not every dependency · checked Nov 21, 2026
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/servers/younghwan91-kiwoom-client)Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
No reviews yet
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
You need to fill in: KIWOOM_APP_KEY, KIWOOM_APP_SECRET
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
The GitHub repo last changed today, and the latest version (0.5.0) reached the registry today.
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.
In the same category: Stripe MCP, FlightClaw, Trade It, Marketplace Ad Pros: Amazon Ads & Seller Central, idealo MCP Server
Same category, other makers, commands already checked. Official ones first, then by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
Stripe’s official server lets AI view and manage customers, products, payments and invoices. Connect to Stripe’s cloud and sign in with OAuth.
Search, price-track and book flights from about 300 airlines, paid on a hosted checkout link.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Search products, compare prices and discover deals across 6 European markets with your AI assistant.
| This one Kiwoom Securities (키움증권) REST API | Stripe MCP | FlightClaw | Trade It | Marketplace Ad Pros: Amazon Ads & Seller Central | idealo MCP Server | |
|---|---|---|---|---|---|---|
| Runs where | Installs on your computer | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install |
| Needs a key | Yes | No | No | No | No | No |
| Add with + in Claude | No | Yes | No | No | No | No |
| Basic checks | 3/3 | 4/4 | 4/4 | 5/5 | 4/4 | 4/4 |
| License | MIT | MIT | MIT | CC0-1.0 | MIT | MIT |
| Price | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry |
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
키움 REST API, 파이썬과 AI 에이전트로. 182개 엔드포인트, 실시간 WebSocket, 그리고 MCP 서버로 AI 에이전트까지 — OpenAPI+ 의 COM/OCX 없이 Windows · macOS · Linux 어디서나 자동매매·데이터 수집 코드가 돌아갑니다. 키움증권과 무관한 비공식 오픈소스입니다.
stock_info_basic_stock_info 같은 도구로 시세·계좌·주문을 직접 부릅니다. 실전 계좌에서는 KIWOOM_MCP_ALLOW_LIVE_ORDERS=true 를 켜기 전까지 주문 도구가 등록조차 되지 않습니다.pip install kiwoom-client
from kiwoom_client import KiwoomAPI
api = KiwoomAPI.from_env(is_mock=True) # KIWOOM_APP_KEY·KIWOOM_APP_SECRET 환경변수 (.env 는 from_env(".env"))
info = api.stock_info.basic_stock_info(stk_cd=api.stock_code("삼성전자")) # 종목명 → 005930 chart = api.chart.stock_daily_chart(stk_cd="005930", base_dt="20260326", upd_stkpc_tp="1") # 일봉 print(info["stk_nm"])
접근토큰은 첫 호출에서 자동 발급되고 만료 전에 갱신되므로 따로 할 일이 없습니다. 앱키·시크릿키는 키움 REST API 포털에서 발급받고, 처음에는 모의투자(is_mock=True)로 시작하세요.
pip install 'kiwoom-client[mcp]'
claude mcp add --transport stdio \ --env KIWOOM_APP_KEY=발급받은_앱키 --env KIWOOM_APP_SECRET=발급받은_시크릿키 --env KIWOOM_IS_MOCK=true \ kiwoom-client -- kiwoom-client-mcp
이제 Claude Code 에서 "삼성전자 지금 얼마야?" 라고 물으면 됩니다. Cursor 등 다른 클라이언트 설정과 환경변수는 MCP 서버로 사용하기.
실서버를 호출하지 않고 만든 예시 화면입니다(시세 값은 가상). 실전투자 서버에서는 KIWOOM_MCP_ALLOW_LIVE_ORDERS=true 를 켜기 전까지 주문 도구가 등록되지 않아, 에이전트가 주문할 방법 자체가 없습니다.
더 읽을거리: 왜 kiwoom-client 인가 — OpenAPI+·pykiwoom·다른 REST 래퍼와 비교 · 엔드포인트 전체 목록
KiwoomAPI 와 AsyncKiwoomAPI 가 같은 엔드포인트를 제공합니다.request_all() 이 cont-yn/next-key 를 끝까지 따라갑니다.to_dataframe() 이 "+70000" 같은 문자열을 숫자로 바꿔 DataFrame 으로 넘깁니다.round_to_tick() 으로 지정가를 KRX 호가단위에 맞춥니다.키움 OpenAPI+(OCX/COM) 와 이를 감싼 pykiwoom 은 32bit Windows 에 묶여 있어 서버 배포·자동화가 어렵습니다. 이 라이브러리는 키움의 신규 REST API 를 쓰므로 그 제약이 없습니다.
| 항목 | 키움 OpenAPI+ (OCX) | pykiwoom | kiwoom-client |
|---|---|---|---|
| 연동 방식 | COM/OCX | OCX 래퍼 | REST + WebSocket |
| 운영체제 | Windows 전용 | Windows 전용 | Windows · macOS · Linux |
| Python 비트수 | 32bit 전용 | 32bit 전용 | 64bit 지원 |
| 서버/헤드리스 배포 | 어려움 (GUI 필요) | 어려움 | 가능 |
| 실시간 데이터 | 이벤트 콜백 | 이벤트 콜백 | async WebSocket |
| 설치 | 별도 모듈 설치 | OCX + 모듈 | `pip install` 한 줄 |
키움 공식 저장소·다른 REST 래퍼까지 넣은 비교는 왜 kiwoom-client 인가, OpenAPI+ TR·함수를 REST 로 옮기는 대응표는 옮겨 오기.
pip install kiwoom-client # 기본
pip install 'kiwoom-client[pandas]' # to_dataframe() 까지 pip install 'kiwoom-client[mcp]' # MCP 서버까지 uv add kiwoom-client # uv 를 쓴다면
git clone 뒤 pip install -e ..env.example 참고.is_mock 과 짝이 맞지 않으면 인증이 거부됩니다.| 구분 | 실전투자 | 모의투자 |
|---|---|---|
is_mock | False (기본값) | True |
| REST URL | https://api.kiwoom.com | https://mockapi.kiwoom.com |
| WebSocket URL | wss://api.kiwoom.com:10000 | wss://mockapi.kiwoom.com:10000 |
evaluation = api.account.account_evaluation(qry_tp="0", dmst_stex_tp="KRX") # 계좌 평가 현황
deposit = api.account.deposit_detail(qry_tp="3") # 예수금 상세 position = api.account.filled_position(dmst_stex_tp="KRX") # 체결 잔고 unfilled = api.account.unfilled_orders(all_stk_tp="0", trde_tp="0", stex_tp="0") # 미체결 주문
result = api.order.buy_order( dmst_stex_tp="KRX", # 거래소 구분: KRX / NXT / SOR stk_cd="005930", # 종목코드 ord_qty="10", # 주문 수량 ord_uv="70000", # 주문 단가 trde_tp="0", # 매매구분: 0 보통(지정가), 3 시장가, 28 스톱지정가 ... ) api.order.sell_order(dmst_stex_tp="KRX", stk_cd="005930", ord_qty="10", ord_uv="75000", trde_tp="0") api.order.modify_order( # 정정 (kt10002) dmst_stex_tp="KRX", orig_ord_no="원주문번호", stk_cd="005930", mdfy_qty="5", mdfy_uv="71000", ) api.order.cancel_order( # 취소 (kt10003) — cncl_qty="0" 이면 잔량 전부 dmst_stex_tp="KRX", orig_ord_no="원주문번호", stk_cd="005930", cncl_qty="5", )
api.logout() # 토큰 폐기 (선택) api.close() # 연결 종료 — with 문을 쓰면 자동
지정가(ord_uv)는 KRX 호가단위의 배수여야 합니다. 아니면 거부되거나 의도와 다른 가격에 체결됩니다.
from kiwoom_client import add_ticks, round_to_tick, tick_size
tick_size(70123) # Decimal('100') (5만~20만원대는 1틱 100원) round_to_tick(70123) # Decimal('70100') (직전 유효 호가로 내림) add_ticks(49950, 2) # Decimal('50100') (구간 경계를 넘는 N틱 이동)
api.order.buy_order( dmst_stex_tp="KRX", stk_cd="005930", ord_qty="10", ord_uv=str(round_to_tick(target_price)), trde_tp="0", )
AsyncKiwoomAPI 는 KiwoomAPI 와 같은 엔드포인트를 제공하며, 호출 앞에 await 만 붙이면 됩니다.
import asyncio
from kiwoom_client import AsyncKiwoomAPI
async def main(): async with AsyncKiwoomAPI(app_key="앱키", app_secret="시크릿키", is_mock=True) as api:
info, chart, ranking = await asyncio.gather( api.stock_info.basic_stock_info(stk_cd="005930"), api.chart.stock_daily_chart(stk_cd="005930", base_dt="20260326", upd_stkpc_tp="1"), api.ranking.top_volume_today( # ka10030 — 필드는 api.describe("ka10030") mrkt_tp="000", sort_tp="1", mang_stk_incls="0", crd_tp="0", trde_qty_tp="0", pric_tp="0", trde_prica_tp="0", mrkt_open_tp="0", stex_tp="3", ), ) print(info["stk_nm"])
asyncio.run(main())
Rate Limiter 는 TR(api_id)별로 걸립니다. 서로 다른 TR 은 서로를 막지 않고 동시에 나가며, 같은 TR 을 반복 호출할 때만 초당 1건으로 조여집니다. 전체 예제는 examples/async_usage.py.
키움은 모든 값을 문자열로 돌려줍니다. 가격은 "+70000", 등락률은 "-1.23", 거래량은 "1,234,567" 같은 식이라 그대로는 계산에 쓸 수 없습니다.
from kiwoom_client import to_dataframe, to_number, normalize
result = api.ranking.top_volume_today(...)
df = to_dataframe(result) # 페이로드 키를 자동으로 찾아 DataFrame 으로 (문자열 → 숫자 포함) print(df["cur_prc"].mean()) # 바로 계산 가능
data = normalize(result) # dict 그대로 쓰고 싶다면 price = to_number("+70000") # 70000
종목코드("005930")처럼 앞자리 0 이 의미를 갖는 값과 base_dt 같은 날짜·식별자 필드는 문자열로 남깁니다. to_dataframe() 에는 pandas 가 필요합니다(pip install 'kiwoom-client[pandas]'). 차트 응답은 to_ohlcv(resp) 가 open/high/low/close/volume + 날짜 인덱스 DataFrame 으로 바꿉니다.
샘플 응답을 to_dataframe() 에 넣은 실제 출력입니다. 시세 값 자체는 예시입니다 — stk_cd 는 문자열로 남고 가격·거래량만 숫자가 되는 것을 보세요.
import asyncio
from kiwoom_client import KiwoomAPI
api = KiwoomAPI(app_key="앱키", app_secret="시크릿키") ws = api.create_websocket()
async def main():
await ws.connect()
ws.on("0B", lambda d: print(f"체결 {d['item']}: {d['values'].get('10')}")) ws.on("0D", lambda d: print(f"호가 {d['item']}: {d['values'].get('41')}"))
async def save(d): ... ws.on("0B", save)
await ws.subscribe("0B", "005930") await ws.subscribe(["0B", "0D"], ["005930", "000660", "035420"])
await ws.listen()
asyncio.run(main())
values 의 키는 키움 FID 번호입니다(10=현재가, 13=누적거래량, 41=매도최우선호가).
조건검색도 같은 WebSocket 을 씁니다. api.condition_search 가 요청 페이로드를 만들고, ws.send() 로 보낸 뒤 ws.on_trnm() 으로 응답을 받습니다.
await ws.connect()
ws.on_trnm("CNSRLST", lambda d: print("조건식 목록:", d["data"])) ws.on_trnm("CNSRREQ", lambda d: print("검색 결과:", d.get("data")))
await ws.send(api.condition_search.condition_list())
await ws.send(api.condition_search.condition_search_realtime(seq="1")) await ws.listen()
검증 상태: 실서버(api.kiwoom.com) 대상으로 LOGIN 핸드셰이크 · PING 프레임 · REG 등록 응답까지 확인했습니다.
다만 REAL 프레임의 항목 필드명(`item`/`values`)은 장 마감 중이라 아직 미확정입니다. 장중 이상 동작을 만나면
이슈로 알려주세요. 직접 확인하려면
python tests/integration_ws_smoke.py --prod.
응답 헤더의 cont-yn 이 "Y" 이면 다음 페이지가 있다는 뜻입니다. request_all() 이 끝까지 따라갑니다.
all_data = api._client.request_all(
"/api/dostk/acnt", "ka10076", data_key="filled_list", # 응답에서 리스트 데이터의 키 이름 )
키움 REST API 는 TR(api_id)별로 독립적인 호출 제한을 둡니다. 실측 결과:
| 항목 | 측정값 |
|---|---|
| 지속(sustained) 안전 속도 | TR당 약 1 req/s (이 속도에선 거부 0) |
| 순간 버스트(burst) 허용량 | TR당 약 2건 |
| 초과 시 응답 | HTTP 429 + {"return_code": 5, "return_msg": "허용된 요청 개수를 초과하였습니다"} |
| 제한 단위 | TR(api_id)별 독립 — 서로 다른 TR은 영향 없음 |
라이브러리는 기본으로 TR별 토큰 버킷(1 req/s, 버스트 2) 을 걸고, 그래도 429 가 나면 *