Skip to content
Back to search

sinotrade

MarketplaceWorks with Claude CodeGitHub

Sinotrade agent plugins for Taiwan trading workflows.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sinotrade--shioaji/badge.svg)](/listings/sinotrade--shioaji)

HTML

<a href="/listings/sinotrade--shioaji"><img src="/api/listings/sinotrade--shioaji/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Expand the section that matches your installation preference.

<a id="install-python"></a> <details> <summary><strong>Python Package</strong></summary>

# uv (recommended)
uv add shioaji

# pip
pip install shioaji

To pin a version, lock the release line, for example `uv add "shioaji==1.7.*"`. PyPI keeps only the latest two patch releases of each line. Releases with the same first two version parts never make incompatible changes, so a line pin is always safe to upgrade within.

</details>

<a id="install-cli"></a> <details> <summary><strong>CLI Tool</strong></summary>

uv tool install shioaji
# or only the CLI, on any Python version:
uv tool install shioaji-cli
shioaji --help

The CLI ships in the regular wheels; free-threaded Python 3.14t wheels do not include it, so install the CLI with a regular Python (the `uv tool install` default).

</details>

<a id="install-binary"></a> <details> <summary><strong>Standalone Installer</strong></summary>

**Linux / macOS:**

# Stable
curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | sh

# Pre-release
curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | CHANNEL=prerelease sh

# Specific version
curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | VERSION=v1.5.6 sh

**Windows (PowerShell):**

# Stable
irm https://github.com/Sinotrade/Shioaji/releases/latest/download/install.ps1 | iex

# Pre-release
$env:CHANNEL="prerelease"; irm https://github.com/Sinotrade/Shioaji/releases/latest/download/install.ps1 | iex

</details>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 19 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "sinotrade",
  3. "owner": {
  4. "name": "Sinotrade",
  5. "url": "https://github.com/Sinotrade"
  6. },
  7. "description": "Sinotrade agent plugins for Taiwan trading workflows.",
  8. "plugins": [
  9. {
  10. "name": "shioaji",
  11. "source": "./plugins/shioaji",
  12. "description": "Shioaji Taiwan financial trading API — Python, CLI, HTTP API, SSE streaming, and multi-language SDK guide",
  13. "version": "1.7.11",
  14. "author": {
  15. "name": "Sinotrade"
  16. }
  17. }
  18. ]
  19. }
README.md · README · 263 lines · 3 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Shioaji
  2. ![shioaji-logo](https://sinotrade.github.io/img/shioaji-mark-on-light-256.png)![sinopac-logo](https://www.sinotrade.com.tw/Images/logo.png)
  3. [![PyPI - Status](https://img.shields.io/pypi/v/shioaji.svg?style=for-the-badge)](https://pypi.org/project/shioaji)
  4. [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/shioaji.svg?style=for-the-badge)]()
  5. [![PyPI - Downloads](https://img.shields.io/pypi/dm/shioaji.svg?style=for-the-badge)](https://pypi.org/project/shioaji)
  6. [![Coverage](https://img.shields.io/badge/coverage%20-99%25-yellowgreen.svg?style=for-the-badge)]()
  7. [![doc](https://img.shields.io/badge/docs%20-passing-orange.svg?style=for-the-badge)](https://sinotrade.github.io/)
  8. [![Telegram](https://img.shields.io/badge/chat-%20on%20telegram-blue.svg?style=for-the-badge)](https://t.me/joinchat/973EyAQlrfthZTk1)
  9. [![Discord](https://img.shields.io/badge/chat-%20on%20discord-5865F2.svg?style=for-the-badge)](https://discord.gg/5nzmWCTnG7)
  10. [繁體中文](README.zh-TW.md)
  11. Shioaji is a trading API provided by Sinopac that offers a comprehensive and user-friendly platform for accessing the Taiwan financial markets. Shioaji is a **cross-language, cross-platform** universal trading platform — accessible through native Python bindings (`import shioaji as sj`) or any HTTP-capable language (JavaScript/TypeScript, Go, C/C++, C#, Rust, Java/Kotlin) for trading stocks, futures, options, and combo orders. On the Python side, Shioaji integrates seamlessly with familiar packages such as numpy, scipy, pandas, pytorch, and tensorflow for building custom trading models; on the HTTP side, a built-in OpenAPI interactive document, SSE real-time streaming, and a visual Dashboard provide live monitoring of server status, SSE connections, CA certificates, accounts, and API usage. Whether for traders new to the world of programmatic trading or experienced developers seeking a more powerful platform, Shioaji is built to deliver. [Sign up for a free account today and start trading with confidence.](https://sinotrade.github.io/tutor/prepare/open_account)
  12. > ✨ **The first Taiwan trading API with AI coding agent skill support** — [Claude Code & Codex CLI](#ai-coding-agent-skills)
  13. - [AI Coding Agent Skills](#ai-coding-agent-skills)
  14. - [Installation](#installation)
  15. - [Python Package](#install-python)
  16. - [CLI Tool](#install-cli)
  17. - [Standalone Installer](#install-binary)
  18. - [Quickstart](#quickstart)
  19. - [Python](#quickstart-python)
  20. - [Cross-language](#quickstart-http)
  21. - [CLI](#quickstart-cli)
  22. - [Conclusion](#conclusion)
  23. - [Communication](#communication)
  24. - [Releases and Contributing](#releases-and-contributing)
  25. - [The Team](#the-team)
  26. ## AI Coding Agent Skills
  27. Shioaji is the **first Taiwan trading API with AI coding agent skill support**. Get AI-assisted guidance on using the Shioaji API.
  28. #### Claude Code
  29. ```bash
  30. claude plugin marketplace add Sinotrade/Shioaji
  31. claude plugin install shioaji
  32. ```
  33. #### Codex
  34. ```bash
  35. codex plugin marketplace add Sinotrade/Shioaji
  36. codex plugin add shioaji@sinotrade
  37. ```
  38. #### Cursor
  39. Install from the [Cursor Marketplace](https://cursor.com/marketplace) after the Shioaji plugin is published, or submit the repository through the [Cursor publisher flow](https://cursor.com/marketplace/publish) for review.
  40. #### Multi-platform Installers (Cursor, Windsurf, Copilot, Codex, and more)
  41. ```bash
  42. npx skills add Sinotrade/Shioaji # skills.sh - 18+ agents
  43. npx skillkit install Sinotrade/Shioaji # skillkit - 32+ agents
  44. npx openskills install Sinotrade/Shioaji # openskills - universal
  45. ```
  46. ## Installation
  47. Expand the section that matches your installation preference.
  48. <a id="install-python"></a>
  49. <details>
  50. <summary><strong>Python Package</strong></summary>
  51. ```bash
  52. # uv (recommended)
  53. uv add shioaji
  54. # pip
  55. pip install shioaji
  56. ```
  57. To pin a version, lock the release line, for example `uv add "shioaji==1.7.*"`. PyPI keeps only the latest two patch releases of each line. Releases with the same first two version parts never make incompatible changes, so a line pin is always safe to upgrade within.
  58. </details>
  59. <a id="install-cli"></a>
  60. <details>
  61. <summary><strong>CLI Tool</strong></summary>
  62. ```bash
  63. uv tool install shioaji
  64. # or only the CLI, on any Python version:
  65. uv tool install shioaji-cli
  66. shioaji --help
  67. ```
  68. The CLI ships in the regular wheels; free-threaded Python 3.14t wheels do not include it, so install the CLI with a regular Python (the `uv tool install` default).
  69. </details>
  70. <a id="install-binary"></a>
  71. <details>
  72. <summary><strong>Standalone Installer</strong></summary>
  73. **Linux / macOS:**
  74. ```bash
  75. # Stable
  76. curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | sh
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 103 on GitHub
  77. # Pre-release
  78. curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | CHANNEL=prerelease sh
  79. # Specific version
  80. curl -fsSL https://github.com/Sinotrade/Shioaji/releases/latest/download/install.sh | VERSION=v1.5.6 sh
  81. ```
  82. **Windows (PowerShell):**
  83. ```bash
  84. # Stable
  85. irm https://github.com/Sinotrade/Shioaji/releases/latest/download/install.ps1 | iex
  86. # Pre-release
  87. $env:CHANNEL="prerelease"; irm https://github.com/Sinotrade/Shioaji/releases/latest/download/install.ps1 | iex
  88. ```
  89. </details>
  90. ## [Quickstart](https://sinotrade.github.io/quickstart/)
  91. Expand the section that matches your preferred development language.
  92. <a id="quickstart-python"></a>
  93. <details>
  94. <summary><strong>Python</strong></summary>
  95. ### Initialization (login + activate certificate)
  96. ```python
  97. import shioaji as sj
  98. api = sj.Shioaji()
  99. accounts = api.login(api_key="YOUR_KEY", secret_key="YOUR_SECRET")
  100. api.activate_ca(
  101. ca_path="/c/your/ca/path/Sinopac.pfx",
  102. ca_passwd="YOUR_CA_PASSWORD",
  103. )
  104. ```
  105. Just import the API library like other popular Python packages and create the instance to start using it. After logging in, the API is ready for market data queries; once the certificate is activated, order placement is enabled.
  106. ### Subscribe to Streaming Market Data
  107. ```python
  108. api.subscribe(api.Contracts.Stocks["2330"], quote_type="tick")
  109. api.subscribe(api.Contracts.Stocks["2330"], quote_type="bid_ask")
  110. api.subscribe(api.Contracts.Futures["TXFC0"], quote_type="tick")
  111. ```
  112. Subscribe to real-time market data. Pass a contract into the `subscribe` function and specify a `quote_type` to begin receiving streaming data.
  113. ### Place Order
  114. ```python
  115. contract = api.Contracts.Stocks["2890"]
  116. order = sj.StockOrder(
  117. price=9.6,
  118. quantity=1,
  119. action=sj.Action.Buy,
  120. price_type=sj.StockPriceType.LMT,
  121. time_in_force=sj.TimeInForce.ROD, # legacy name order_type= is still accepted
  122. order_lot=sj.StockOrderLot.Common,
  123. account=api.stock_account,
  124. )
  125. trade = api.place_order(contract, order)
  126. ```
  127. As with subscribing to market data using a contract, an order must first be defined and then passed alongside the contract into the `place_order` function. The function returns a `trade` object representing the order's status.
  128. </details>
  129. <a id="quickstart-http"></a>
  130. <details>
  131. <summary><strong>Cross-language</strong></summary>
  132. ### Start the Server
  133. ```bash
  134. shioaji server start
  135. ```
  136. Once the server is running, all trading capabilities are exposed as RESTful endpoints accessible from any HTTP-capable language (JavaScript, Go, C#, Java, Rust, C/C++, etc.).
  137. Verify that the server has started successfully:
  138. ```bash
  139. curl http://localhost:8080/api/v1/health
  140. ```
  141. ### Getting Started
  142. Once the server is running, the following entry points are available:
  143. | Purpose | URL |
  144. |---------|-----|
  145. | Dashboard (live monitoring & management) | `http://localhost:8080/` |
  146. | OpenAPI document (browse API, run tests in-browser) | `http://localhost:8080/docs` |
  147. | Custom apps (entry point for self-uploaded web apps) | `http://localhost:8080/apps/<name>/` |
  148. Open `/docs` to browse all endpoints, inspect request/response schemas, generate code samples in multiple languages, and test directly from the browser.
  149. For agent-facing deployments, the optional [`agent_harness`](docs/agent-harness.md)
  150. middleware can require short-lived, payload-bound, one-time capabilities on
  151. broker mutations without adding work to read-only routes.
  152. ### Custom Web Apps
  153. Custom web apps can be uploaded from the Dashboard's **Custom Apps** card and run alongside the Dashboard; once uploaded, an app is served at `http://localhost:8080/apps/<name>/`.
  154. - **Supported formats**: a single HTML file, or a build output folder from frontend frameworks such as Vite / React / Vue (containing `index.html`).
  155. - **Upload steps**: log in to the Dashboard → click **Custom Apps** → **Upload** → select the file or folder → set the application name `<name>`.
  156. - **Project template**: [`@sinotrade/create-shioaji-app`](https://www.npmjs.com/package/@sinotrade/create-shioaji-app) — scaffolds a Shioaji frontend project with one command.
  157. </details>
  158. <a id="quickstart-cli"></a>
  159. <details>
  160. <summary><strong>CLI</strong></summary>
  161. The `shioaji` CLI provides direct server management, market data queries, and order placement.
  162. ```bash
  163. shioaji --help # list all commands
  164. shioaji tree --all # show full command tree (with parameters and descriptions)
  165. ```
  166. **Server Management**
  167. | Purpose | Command |
  168. |---------|---------|
  169. | Start HTTP server (simulation mode) | `shioaji server start` |
  170. | Start HTTP server (production mode) | `shioaji server start --production` |
  171. | Check mode and authentication status | `shioaji server check` |
  172. | Show daemon status | `shioaji server status` |
  173. | Stop daemon | `shioaji server stop` |
  174. </details>
  175. ## Conclusion
  176. This quickstart shows the multiple ways to access Shioaji — from native Python, HTTP API, and CLI to custom web apps. The focus is on building an easy-to-use, cross-language trading API that lets any developer trade Taiwan's financial markets with confidence.
  177. For more usage details, see
  178. [![doc](https://img.shields.io/badge/docs%20-passing-orange.svg?style=for-the-badge)](https://sinotrade.github.io/)
  179. ## Communication
  180. [![Telegram](https://img.shields.io/badge/chat-%20on%20telegram-blue.svg?style=for-the-badge)](https://t.me/joinchat/973EyAQlrfthZTk1)
  181. [![Discord](https://img.shields.io/badge/chat-%20on%20discord-5865F2.svg?style=for-the-badge)](https://discord.gg/5nzmWCTnG7)
  182. ## Releases and Contributing
  183. Shioaji has a 14 day release cycle. See the release [change log](https://sinotrade.github.io/release/). Please let us know if you encounter a bug by [filing an issue](https://github.com/Sinotrade/Shioaji/issues).
  184. We appreciate all suggestions. If you have any idea you'd like to see implemented, feel free to discuss with us on Telegram or Discord.
  185. ## The Team
  186. Shioaji is currently maintained by [Sally](https://github.com/SsallyLin), [Yvictor](https://github.com/Yvictor), [Zecheng](https://github.com/zechengwang724) and [Po Chien Yang](https://github.com/ypochien) with major contributions.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.