/shioaji
Shioaji (SJ) is SinoPac/永豐金證券's API for trading Taiwan markets (台股/期權 on TWSE, TPEX, TAIFEX). Use for any Shioaji task, or for Taiwan trading automation where Shioaji may apply: Python sync/async code, the `shioaji` CLI, the local HTTP API server with SSE streaming, or HTTP
Claude Code
$ npx -y skills add Sinotrade/Shioaji --skill shioaji --agent claude-code
Codex
$ npx skills add Sinotrade/Shioaji --skill shioaji -a codex -y
Cursor
$ npx skills add Sinotrade/Shioaji --skill shioaji -a cursor -y
Gemini CLI
$ npx skills add Sinotrade/Shioaji --skill shioaji -a gemini-cli -y
GitHub Copilot
$ npx skills add Sinotrade/Shioaji --skill shioaji -a github-copilot -y
OpenCode
$ npx skills add Sinotrade/Shioaji --skill shioaji -a opencode -y
Windsurf
$ npx skills add Sinotrade/Shioaji --skill shioaji -a windsurf -y
SKILL.md
shioaji.SKILL.mdname: shioaji
description: >-
Shioaji (SJ) is SinoPac/永豐金證券's API for trading Taiwan markets
(台股/期權 on TWSE, TPEX, TAIFEX) and, since the 1.8.0b1 pre-release,
US stocks (美股複委託 on NASDAQ, NYSE, BATS, TXSE). Use for any Shioaji
task, or for Taiwan or US stock trading automation where Shioaji may
apply: Python sync/async code, the `shioaji` CLI, the local HTTP API
server with SSE streaming, or HTTP clients in JS/TS, Go, C/C++, C#,
Rust, Java/Kotlin. Covers login, API keys and CA, contracts, placing
and managing orders (下單/改單/刪單), order reports, real-time quotes
and K-bars (即時行情), historical data, market signals, accounts and
positions, dividends, watchlists, reserve orders, migration, and
troubleshooting errors. Also use when someone wants to start using
Shioaji or get SinoPac API access for the first time. HK and other
markets are not supported. Not for other brokers or generic indicators
without Shioaji data.
Shioaji Trading API
Shioaji is SinoPac's **cross-language, cross-platform** trading API for Taiwan financial markets (TWSE/TPEX/TAIFEX). It includes Python bindings, a CLI, and an HTTP API server that lets **any programming language** trade Taiwan markets.
Shioaji 是永豐金證券的**跨語言、跨平台**交易 API,提供 Python 綁定、CLI 與 HTTP API 伺服器,讓**任何程式語言**都能透過 HTTP API 交易台灣市場。
> **US stocks 美股 (1.8.0b1 pre-release 預發行版).** US stock contracts, orders, active reports, accounting, realtime quotes, snapshots and historical ticks / K-bars are supported from 1.8.0b1, a pre-release: install it with `pip install --pre shioaji` (or `uv add --prerelease allow shioaji`) or pin `shioaji==1.8.0b1`; a plain `pip install shioaji` keeps the stable version without US support. US trading needs an Intl (`H`, 複委託) account. HK and other markets are not supported. Start from [US stock references](#us-stocks--美股). > 1.8.0b1 預發行版起支援美股(商品檔、下單、回報、帳務、即時行情、快照與歷史逐筆/K 棒),用 `pip install --pre shioaji` 或指定 `shioaji==1.8.0b1` 安裝;一般 `pip install shioaji` 仍是不含美股的穩定版。美股要用複委託(H)帳戶;港股等其他市場不支援。
Three access layers / 三種存取層:
- **Python** — native PyO3 binding (`import shioaji`) for best performance, sync and async
- **CLI** — `shioaji` command-line tool for server management, trading, and data queries
- **HTTP API + SSE** — REST endpoints + real-time streaming at `localhost:8080`, accessible from JS/TS, Go, C/C++, C#, Rust, Java/Kotlin, or any HTTP client
> **Reasoning about connections, timeouts, processes, or state? Read [CONCEPTS.md](references/CONCEPTS.md) first.** It is the shared mental model these three layers assume — which timeout applies on which path, why Python needs no server but CLI/HTTP share one daemon, the per-person connection cap, streaming vs request-reply. Answer those questions from CONCEPTS.md instead of guessing. > **推理連線、逾時、行程或狀態時,先讀 [CONCEPTS.md](references/CONCEPTS.md)。** 這是三個存取層共用的心智模型 — 哪個 timeout 在哪條路徑生效、為何 Python 不需 server 而 CLI/HTTP 共用一個 daemon、每人連線上限、串流 vs 請求-回覆。這類問題從 CONCEPTS.md 找答案,不要猜。
How to Use References / 如何使用參考文件
Answer users directly from the bundled references. Do not route users to external documentation pages as a substitute for answering. The stable 1.5 API remains the compatibility baseline, while 1.7 features that intentionally change the interface—especially Contract V2—must follow their functional reference. Use [MIGRATION.md](references/MIGRATION.md) only for legacy/deprecated idioms. Response handling always belongs in the matching functional reference. When an exact command flag, request field, or response schema must be confirmed, use installed CLI `--help` or the running server's `/openapi.json`.
**First-time-user response / 首次使用者回應:**
- Use this path only when the user says or clearly implies they have not used Shioaji before, are using it for the first time, do not know how to start, or may not have completed SinoPac API onboarding. Do not treat every broad "I want to use Shioaji" request as first-time by default.
- For confirmed/likely first-time users, load [PREPARE.md](references/PREPARE.md). Treat the first response as an eligibility/onboarding conversation, because they may not even have a SinoPac account or API access yet.
- In a confirmed/likely first-time context, if the user says "walk me through", "step by step", "一步一步帶我", "慢慢來", or similar, continue the onboarding sequence from the first unconfirmed external gate. Do not reinterpret that as permission to inspect the workspace or create a local starter project.
- Before the user answers the first onboarding question, do not run commands, inspect files, mention Python versions, mention existing projects, or discuss local environments. The first step is not "check the folder"; it is "check whether the user can open/use SinoPac API at all."
- The first substantive response must check the basic gates before any technical setup: SinoPac securities/futures account, desired market access (stock / futures-options / both), API key/secret, direct API agreement signing, simulation login/order test, CA for production, and production-readiness check.
- Onboarding order matters: after account opening, confirm/create API Key and Secret Key at `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; signing pages do not issue API keys. After signing, do not jump straight to CA; confirm API credentials and run the required simulation login/order tests first. CA download is from the API management page, not the signing pages.
- When presenting onboarding steps as a table/list, write the explicit correct URL for each web step. Never use the generic SinoPac home page as the account-opening URL. Open account uses `https://www.sinotrade.com.tw/openact?strProd=0254&strWeb=0684&s=013299&utm_source=shioaji`; API Key and CA use `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; stock signing uses `https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/`; futures/options signing uses `https://www.sinotrade.com.tw/newweb/signCenter/F_openApi/`. Never write "same page"/"同上頁面" for API Key or CA when the previou
Read more
name: shioaji description: >- Shioaji (SJ) is SinoPac/永豐金證券's API for trading Taiwan markets (台股/期權 on TWSE, TPEX, TAIFEX) and, since the 1.8.0b1 pre-release, US stocks (美股複委託 on NASDAQ, NYSE, BATS, TXSE). Use for any Shioaji task, or for Taiwan or US stock trading automation where Shioaji may apply: Python sync/async code, the `shioaji` CLI, the local HTTP API server with SSE streaming, or HTTP clients in JS/TS, Go, C/C++, C#, Rust, Java/Kotlin. Covers login, API keys and CA, contracts, placing and managing orders (下單/改單/刪單), order reports, real-time quotes and K-bars (即時行情), historical data, market signals, accounts and positions, dividends, watchlists, reserve orders, migration, and troubleshooting errors. Also use when someone wants to start using Shioaji or get SinoPac API access for the first time. HK and other markets are not supported. Not for other brokers or generic indicators without Shioaji data.
Shioaji Trading API
Shioaji is SinoPac's **cross-language, cross-platform** trading API for Taiwan financial markets (TWSE/TPEX/TAIFEX). It includes Python bindings, a CLI, and an HTTP API server that lets **any programming language** trade Taiwan markets.
Shioaji 是永豐金證券的**跨語言、跨平台**交易 API,提供 Python 綁定、CLI 與 HTTP API 伺服器,讓**任何程式語言**都能透過 HTTP API 交易台灣市場。
> **US stocks 美股 (1.8.0b1 pre-release 預發行版).** US stock contracts, orders, active reports, accounting, realtime quotes, snapshots and historical ticks / K-bars are supported from 1.8.0b1, a pre-release: install it with `pip install --pre shioaji` (or `uv add --prerelease allow shioaji`) or pin `shioaji==1.8.0b1`; a plain `pip install shioaji` keeps the stable version without US support. US trading needs an Intl (`H`, 複委託) account. HK and other markets are not supported. Start from [US stock references](#us-stocks--美股). > 1.8.0b1 預發行版起支援美股(商品檔、下單、回報、帳務、即時行情、快照與歷史逐筆/K 棒),用 `pip install --pre shioaji` 或指定 `shioaji==1.8.0b1` 安裝;一般 `pip install shioaji` 仍是不含美股的穩定版。美股要用複委託(H)帳戶;港股等其他市場不支援。
Three access layers / 三種存取層:
- **Python** — native PyO3 binding (`import shioaji`) for best performance, sync and async
- **CLI** — `shioaji` command-line tool for server management, trading, and data queries
- **HTTP API + SSE** — REST endpoints + real-time streaming at `localhost:8080`, accessible from JS/TS, Go, C/C++, C#, Rust, Java/Kotlin, or any HTTP client
> **Reasoning about connections, timeouts, processes, or state? Read [CONCEPTS.md](references/CONCEPTS.md) first.** It is the shared mental model these three layers assume — which timeout applies on which path, why Python needs no server but CLI/HTTP share one daemon, the per-person connection cap, streaming vs request-reply. Answer those questions from CONCEPTS.md instead of guessing. > **推理連線、逾時、行程或狀態時,先讀 [CONCEPTS.md](references/CONCEPTS.md)。** 這是三個存取層共用的心智模型 — 哪個 timeout 在哪條路徑生效、為何 Python 不需 server 而 CLI/HTTP 共用一個 daemon、每人連線上限、串流 vs 請求-回覆。這類問題從 CONCEPTS.md 找答案,不要猜。
How to Use References / 如何使用參考文件
Answer users directly from the bundled references. Do not route users to external documentation pages as a substitute for answering. The stable 1.5 API remains the compatibility baseline, while 1.7 features that intentionally change the interface—especially Contract V2—must follow their functional reference. Use [MIGRATION.md](references/MIGRATION.md) only for legacy/deprecated idioms. Response handling always belongs in the matching functional reference. When an exact command flag, request field, or response schema must be confirmed, use installed CLI `--help` or the running server's `/openapi.json`.
**First-time-user response / 首次使用者回應:**
- Use this path only when the user says or clearly implies they have not used Shioaji before, are using it for the first time, do not know how to start, or may not have completed SinoPac API onboarding. Do not treat every broad "I want to use Shioaji" request as first-time by default.
- For confirmed/likely first-time users, load [PREPARE.md](references/PREPARE.md). Treat the first response as an eligibility/onboarding conversation, because they may not even have a SinoPac account or API access yet.
- In a confirmed/likely first-time context, if the user says "walk me through", "step by step", "一步一步帶我", "慢慢來", or similar, continue the onboarding sequence from the first unconfirmed external gate. Do not reinterpret that as permission to inspect the workspace or create a local starter project.
- Before the user answers the first onboarding question, do not run commands, inspect files, mention Python versions, mention existing projects, or discuss local environments. The first step is not "check the folder"; it is "check whether the user can open/use SinoPac API at all."
- The first substantive response must check the basic gates before any technical setup: SinoPac securities/futures account, desired market access (stock / futures-options / both), API key/secret, direct API agreement signing, simulation login/order test, CA for production, and production-readiness check.
- Onboarding order matters: after account opening, confirm/create API Key and Secret Key at `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; signing pages do not issue API keys. After signing, do not jump straight to CA; confirm API credentials and run the required simulation login/order tests first. CA download is from the API management page, not the signing pages.
- When presenting onboarding steps as a table/list, write the explicit correct URL for each web step. Never use the generic SinoPac home page as the account-opening URL. Open account uses `https://www.sinotrade.com.tw/openact?strProd=0254&strWeb=0684&s=013299&utm_source=shioaji`; API Key and CA use `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; stock signing uses `https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/`; futures/options signing uses `https://www.sinotrade.com.tw/newweb/signCenter/F_openApi/`. Never write "same page"/"同上頁面" for API Key or CA when the previou
Shioaji is a trading API provided by Sinopac that offers a comprehensive and user-friendly platform for accessing the Taiwan financial markets.
More skills from other plugins.
3-statement-model
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
3-statement-model
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Questions about shioaji.
- Which coding agents can use shioaji?
- shioaji installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

