Skip to content

kuil09/tossinvest-openapi-cli

Repository files navigation

tossinvest-openapi-cli

Open-source CLI wrappers for the Toss Securities Open API.

What this repository contains

  • tossinvest — low-level programmable CLI for auth, market data, holdings, order info, orders, and raw requests
  • tossinvest-snapshot — holdings + buying power + FX snapshot helper
  • tossinvest-order-approval — Korean approval-packet generator for proposed live orders

Safety stance

Live order mutations are blocked by default. The CLI only sends create / modify / cancel requests when both of these flags are present:

tossinvest orders create ... --execute --confirm-live

That default is intentional so other agents and scripts can use the tool without accidentally sending live orders.

Installation

From source

python3 -m pip install .

Editable install for development

python3 -m pip install -e .

Environment variables

Required:

  • TOSSINVEST_API_KEY
  • TOSSINVEST_SECRET_KEY

Optional:

  • TOSSINVEST_ACCOUNT_SEQ
  • TOSSINVEST_BASE_URL (defaults to https://openapi.tossinvest.com)

Example:

export TOSSINVEST_API_KEY="your_client_id"
export TOSSINVEST_SECRET_KEY="your_client_secret"
export TOSSINVEST_ACCOUNT_SEQ="1"

Quick start

tossinvest env-check
tossinvest doctor
tossinvest token
tossinvest accounts
tossinvest holdings
tossinvest market prices --symbols 005930,AAPL
tossinvest order-info buying-power --currency KRW
tossinvest-snapshot
tossinvest-order-approval --symbol 005930 --side BUY --order-type LIMIT --quantity 1 --price 350000

Publish checklist

  • Verify doctor succeeds from a clean shell with env vars injected
  • Confirm no secret values are committed
  • Update version in pyproject.toml
  • Tag a release

Notes

  • Tokens are cached under ~/.cache/tossinvest-openapi/token.json
  • Account-scoped APIs automatically send X-Tossinvest-Account
  • If auth returns access_denied / IP address not allowed, whitelist the machine's public IP in Toss Securities WTS > Open API settings

License

MIT

About

CLI and helper tools for Toss Securities Open API

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages