Read-only interface to Toss Securities accounts through the tossctl CLI. It wraps JungHoonGhae/tossinvest-cli to query account summaries, portfolio positions, stock quotes, order history, and watchlists without touching any trading mutations. Requires macOS with Homebrew and browser-based login through tossctl auth. The defensive design is smart: it won't let you accidentally place orders, explicitly converts relative dates to absolute ones, and minimizes exposure of account numbers. Good for dashboards or automated portfolio reporting in Korean. If the upstream web API changes, you'll need to wait for tossctl itself to update.
npx -y skills add nomadamas/k-skill --skill toss-securities --agent claude-codeInstalls into .claude/skills of the current project.
토스증권 조회 전용(read-only) 흐름을 실행한다. 두 경로가 있다.
https://openapi.tossinvest.com)를 OAuth 2.0 Client Credentials 토큰으로 호출.JungHoonGhae/tossinvest-cli 의 tossctl 을 사용.조회 항목:
client_id / client_secretfetch)자격 증명은 사용자 환경변수로 두고 helper가 토스 서버로 직접 호출한다. 공유 프록시로 보내지 않는다.
| 환경변수 | 설명 |
|---|---|
TOSSINVEST_CLIENT_ID | client id (필수) |
TOSSINVEST_CLIENT_SECRET | client secret (필수) |
TOSSINVEST_ACCOUNT | accountSeq. 계좌·자산·주문조회에 필요 (선택) |
TOSSINVEST_API_BASE_URL | 기본 https://openapi.tossinvest.com (선택) |
helper는 내부적으로 POST /oauth2/token 으로 토큰을 발급(Client Credentials)받아 Authorization: Bearer 로 호출한다. 계좌·자산·주문조회 API는 X-Tossinvest-Account 헤더가 추가로 필요하다.
const {
getPrices,
listOfficialAccounts,
getHoldings
} = require("toss-securities");
async function main() {
const prices = await getPrices(["005930", "AAPL"]);
const accounts = await listOfficialAccounts();
const accountSeq = accounts.data.result[0].accountSeq;
const holdings = await getHoldings({ account: accountSeq });
console.log(prices.data);
console.log(holdings.data);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
429 는 Retry-After/X-RateLimit-Reset 만큼 대기 후 백오프 재시도한다.401 은 토큰을 1회 재발급해 재시도한다.client_secret/토큰은 에러 메시지에서 마스킹된다.공식 credentials가 없으면 비공식 tossctl 을 fallback으로 쓴다.
tossctl first when missingbrew tap JungHoonGhae/tossinvest-cli
brew install tossctl
tossctl doctor
tossctl auth doctor
tossctl auth login
로그인 세션이 없으면 먼저 위 흐름을 끝낸다. 다른 비공식 크롤링이나 임의 HTTP 재구현으로 우회하지 않는다.
지원하는 read-only 명령:
tossctl account summary --output jsontossctl portfolio positions --output jsontossctl quote get TSLA --output jsontossctl watchlist list --output jsontossctl orders completed --market all --output json패키지 wrapper(getAccountSummary, getPortfolioPositions, getQuote, listWatchlist 등)도 그대로 쓸 수 있다.
TOSSINVEST_CLIENT_ID/SECRET)가 없으면 TossCredentialsError 로 명확히 실패한다.X-Tossinvest-Account 가 없으면 네트워크 호출 전에 실패한다.auth login 전이면 계좌/포트폴리오 조회가 실패할 수 있다.juliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills