2026-10-13

0.05 seconds. That is how long the official Python sample from Korea Investment & Securities waits between API calls on a live account. Switch it to a paper (demo) account and the wait becomes 0.5 seconds.
Most tutorials on building a Python stock trading bot for Korean stocks stop at installation and order code. What tends to stop the bot on its first day is a limit written somewhere in the broker's documents. We pulled only the numbers found in official documents and grouped them into five checks.
The official Korea Investment & Securities repository (open-trading-api) has separate slots in its config file for the live app key and the paper app key. The account number has its own paper slot too.
The addresses differ as well.
The repository's auth file lists live as openapi.koreainvestment.com on port 9443 and paper as openapivts.koreainvestment.com on port 29443.
Kiwoom's REST API guide also splits a live domain (api.kiwoom.com) from a paper domain (mockapi.kiwoom.com).
Before going live, write down which lines change: the key, the account number and the address. If a single paper value is left behind, orders go to the wrong place or authentication fails outright.
The repository's guide says paper accounts have a lower REST API call limit. The actual numbers sit inside the sample code: set it to live and it waits 0.05 seconds between calls, set it to paper and it waits 0.5 seconds.
Call gap: the wait between one API call and the next. 0.05 seconds works out to 20 calls a second, 0.5 seconds to 2.
Go over the limit and the API returns a too-many-calls-per-second error (EGW00201), according to the same guide. The more stocks the bot watches, the more the gap matters.
Assume the bot checks the current price of 50 stocks once each and time one full sweep.

If one sweep takes 25 seconds on paper, prices move in the meantime. That is one reason the same strategy can score differently on paper and live, even when not a single line of code has changed.
It works the other way too.
Code tuned to the live gap throws EGW00201 errors first when run on a paper account. If the bot simply moves on to the next stock after an error, that stock passes by without ever being checked.
When logging paper results, note how many seconds one sweep took. Live, the same code runs ten times faster.
Keep the gap in a config file rather than in the code. If the broker changes its policy, there is only one place to fix.
If the bot needs prices without pause, use a WebSocket instead of repeating calls. The official repository has separate functions for issuing a REST access token and a WebSocket key.
A comment in the official auth file gives the access token a validity of one day. Requesting again within six hours returns the same token, and a KakaoTalk notice goes out each time one is issued.
The guide says a token can be reissued once per minute. A bot that restarts the whole script after every error will request a new token each time and hit that limit quickly.

Save the token to a file with the time it was issued, and read that file first on every start. Kiwoom's REST API also returns an expiry date (expires_dt) with the token.
The market hours table in the Korea Exchange handbook puts regular session order taking at 08:30 to 15:30, seven hours. Trading runs from 09:00 to 15:30, six hours 30 minutes.

A pre-market off-hours session runs from 08:00 to 09:00. After the close, orders are taken from 15:30 to 18:00 and trading runs from 15:40 to 18:00.
Even with the bot running around the clock, regular orders only fill inside these hours. Fetching the day's new token before 08:30 keeps authentication from dropping mid-session.
On December 30, 2025, the Korean cabinet approved a change to the securities transaction tax decree. KOSPI went from 0% to 0.05% and KOSDAQ from 0.15% to 0.20%. KOSPI sales also carry a separate 0.15% special tax for rural development, so in both markets every sale costs 0.20% of the amount sold.
Assume the bot sells 1 million won a day over 20 trading days a month. That is 20 million won sold and 40,000 won in tax. Broker fees vary by broker and order channel, so check the fee table of the one in use.
How to work out the break-even win rate with fees included is covered in our post on building a trading bot.
Writing down the paper and live keys and addresses, the call gap, how the token is stored, the market hours and the tax per sale as one number each shortens the hunt for why the bot stopped on day one.
Hiddenpick is a Windows program that keeps on its server the betting rules that pick owners do not make public, and runs them as they are on the PC of the person who received them through a referral code. It currently runs on Evolution live baccarat at Stake (stake.com). How a program carries out a fixed set of rules on someone's behalf is explained in the baccarat auto betting guide. We are recruiting national pickster representatives, and those selected receive benefits worth $12,000, a one-year pass (apply at hiddenpick.my/pickster).