shioaji

shioaji is a skill for Claude Code, Codex from nicepkg/ai-workflow. It costs 85 tokens per session (1,939 once invoked), scanned A, original, MIT.

A Python guide for Shioaji, SinoPac’s API for trading Taiwanese stocks, futures, and options and accessing related market and account data.

In plain words
What is it for?
Use it when building or troubleshooting trading software that places, changes, or cancels orders, receives real-time prices, reads historical data, or checks balances and profit and loss.
Why use it?
It explains the steps and concepts needed to connect software to Taiwan’s financial markets, including contracts, orders, live quotes, and account records.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nicepkg/ai-workflow/shioaji
Any agent
npx skills add nicepkg/ai-workflow --skill shioaji
Clone the repo
git clone --depth 1 https://github.com/nicepkg/ai-workflow

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shioaji

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicepkg/ai-workflow/shioaji.svg)](https://agentmods.dev/skills/nicepkg/ai-workflow/shioaji)
Your own site
<a href="https://agentmods.dev/skills/nicepkg/ai-workflow/shioaji"><img src="https://agentmods.dev/badge/skills/nicepkg/ai-workflow/shioaji.svg" alt="Measured on agentmods" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,939 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00085 $0.01939
Opus 5 $0.00043 $0.00970
Sonnet 5 $0.00017 $0.00388
Haiku 4.5 $0.00009 $0.00194

Measured yesterday against content hash ce5dcd7058df, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

shioaji scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workflows/stock-trader-workflow/.claude/skills/shioaji/SKILL.md · 262 lines

How it starts

The opening of the file, as written. The whole thing — 262 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Shioaji Trading API

Shioaji is SinoPac's Python API for trading Taiwan financial markets (stocks, futures, options). Shioaji 是永豐金證券提供的 Python 交易 API,支援台灣股票、期貨、選擇權市場。

Official Docs 官方文檔: https://sinotrade.github.io/ LLM Reference: https://sinotrade.github.io/llms-full.txt


Topic 主題 File 檔案 Description 說明
Preparation 準備 PREPARE.md Account setup, API keys, testing 開戶/金鑰申請/測試
Contracts 合約 CONTRACTS.md Stocks, Futures, Options contracts 股票/期貨/選擇權合約
Orders 下單 ORDERS.md Place, modify, cancel, combo orders 下單/改單/刪單/組合單
Reserve 預收 RESERVE.md Reserve orders for disposition stocks 處置股預收券款
Streaming 行情 STREAMING.md Real-time tick & bidask data 即時 Tick/BidAsk 資料
Market Data 市場資料 MARKET_DATA.md Historical, snapshot, credit, scanners 歷史資料/快照/資券/掃描器
Accounting 帳務 ACCOUNTING.md Balance, margin, P&L, trading limits 餘額/保證金/損益/額度
Advanced 進階 ADVANCED.md Quote binding, non-blocking, stop orders 報價綁定/非阻塞/觸價
Troubleshooting 問題排解 TROUBLESHOOTING.md Common issues and solutions 常見問題與解決

Quick Start 快速入門

Installation 安裝

# pip
pip install shioaji

# uv (recommended 推薦)
uv add shioaji

# with speed optimization 速度優化版
uv add shioaji --extra speed

# Docker
docker run -it sinotrade/shioaji:latest

Login & Activate CA 登入與憑證啟用

import shioaji as sj

api = sj.Shioaji()

# Login with API Key 使用 API Key 登入
accounts = api.login(
    api_key="YOUR_API_KEY",
    secret_key="YOUR_SECRET_KEY"
)

# Activate CA certificate 啟用憑證 (required for placing orders 下單必須)
api.activate_ca(
    ca_path="/path/to/Sinopac.pfx",
    ca_passwd="YOUR_CA_PASSWORD",
)

Simulation Mode 模擬模式

Test API without real money. 使用模擬環境測試 API。

import shioaji as sj

api = sj.Shioaji(simulation=True)
api.login(api_key="YOUR_KEY", secret_key="YOUR_SECRET")

Read the full file on GitHub · 262 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 262 lines · 85 tokens per session scan A ce5dcd7058df

Subscribe to this mod's changes

shioaji is a skill published in the GitHub repository nicepkg/ai-workflow (283 stars, last pushed 7mo ago), licensed MIT. It adds 85 tokens to every session and 1,939 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories