kiwoom

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Kiwoom adapter

The raw adapter covers the committed documented REST endpoints. WebSocket subscriptions and condition search are not implemented. The common quote and OHLCV methods cover domestic markets; use raw REST endpoints for US data.

Continuation

CallEndpoint retains its original response type. For paginated REST results, use the optional kiwoom.PageCaller interface implemented by the built-in adapter. CallEndpointPage returns one kiwoom.EndpointPage: Data has the same type as the legacy response, while ContYN and NextKey carry the broker's continuation headers. Send both fields from a response with ContYN == "Y" as the kiwoom.Continuation argument to the next call. A blank continuation starts a new query. Each call sends exactly one request, including order endpoints.

HTTP proxy routes preserve their existing JSON response and expose cont-yn and next-key response headers. Send those headers back to request the next page. The generic proxy also accepts a top-level body field:

{"continuation": {"cont_yn": "Y", "next_key": "previous-response-key"}}

Common GetPositions calls collect all pages before returning. GetOHLCV collects descending bars until the requested result limit or earliest date is covered; older pages are then unnecessary. With no such bound it collects all pages. Both reject intermediate failures, invalid or repeated cursors, and responses exceeding 100 pages or 100,000 rows, returning an error instead of partial data. Charts also reject malformed dates or bars out of descending order. The returned bars respect the requested date range and result limit.

Domestic market selection

Common market data calls map market=NXT to a _NX stock-code suffix and market=SOR to _AL. Explicit stock-code suffixes must agree with a supplied market. If the market is omitted, an explicit suffix selects that venue. Quote responses contain the plain stock code and the selected market separately.

GetPositions uses the documented aggregate query mode (qry_tp=1). GetBalance reads withdrawable cash from pymn_alow_amt; if omitted by Kiwoom, unavailable_fields contains withdrawable_cash instead of assuming it equals buying power.

Documentation

Overview

Package kiwoom exposes the public Kiwoom Securities adapter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileTokenManager

func NewFileTokenManager() tokencache.Manager

NewFileTokenManager creates a Kiwoom file-backed token manager.

func NewFileTokenManagerWithDir

func NewFileTokenManagerWithDir(dir string) tokencache.Manager

NewFileTokenManagerWithDir creates a Kiwoom file-backed token manager with a fixed directory.

Types

type Adapter

type Adapter interface {
	adapter.Adapter
	CallEndpoint(ctx context.Context, method, path, apiID string, request any) (any, error)
}

Adapter is the public Kiwoom adapter contract.

func NewAdapterWithOptions

func NewAdapterWithOptions(sandbox bool, accountID string, opts adapter.Options) Adapter

NewAdapterWithOptions creates a Kiwoom adapter with injectable options.

type Continuation added in v0.28.0

type Continuation = specs.Continuation

Continuation carries Kiwoom's cont-yn and next-key headers.

type EndpointPage added in v0.28.0

type EndpointPage = specs.EndpointPage

EndpointPage returns endpoint data together with continuation headers.

type PageCaller added in v0.28.0

type PageCaller interface {
	CallEndpointPage(ctx context.Context, method, path, apiID string, request any, continuation Continuation) (*EndpointPage, error)
}

PageCaller is an optional extension implemented by the built-in adapter. Existing custom implementations of Adapter remain source-compatible.

Directories

Path Synopsis
Package specs preserves compatibility for Kiwoom APIs retired on 2026-09-12 at 21:00 KST.
Package specs preserves compatibility for Kiwoom APIs retired on 2026-09-12 at 21:00 KST.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL