Skip to main content

Shioaji

shioaji-logosinopac-logo

PyPI - Status PyPI - Python Version PyPI - Downloads Coverage doc Telegram Discord

繁體中文

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.

✨ The first Taiwan trading API with AI coding agent skill support — Claude Code & Codex CLI

AI Coding Agent Skills

Shioaji is the first Taiwan trading API with AI coding agent skill support. Get AI-assisted guidance on using the Shioaji API.

Claude Code

claude plugin marketplace add Sinotrade/Shioaji
claude plugin install shioaji

Multi-platform Installers (Cursor, Windsurf, Copilot, Codex, and more)

npx skills add Sinotrade/Shioaji                # skills.sh - 18+ agents
npx skillkit install Sinotrade/Shioaji          # skillkit - 32+ agents
npx openskills install Sinotrade/Shioaji        # openskills - universal

Installation

Expand the section that matches your installation preference.

Python Package
# uv (recommended)
uv add shioaji

# pip
pip install shioaji

CLI Tool
uv tool install shioaji
shioaji --help

Standalone Installer

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

Quickstart

Expand the section that matches your preferred development language.

Python

Initialization (login + activate certificate)

import shioaji as sj

api = sj.Shioaji()
accounts = api.login(api_key="YOUR_KEY", secret_key="YOUR_SECRET")
api.activate_ca(
    ca_path="/c/your/ca/path/Sinopac.pfx",
    ca_passwd="YOUR_CA_PASSWORD",
)

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.

Subscribe to Streaming Market Data

api.subscribe(api.Contracts.Stocks["2330"], quote_type="tick")
api.subscribe(api.Contracts.Stocks["2330"], quote_type="bid_ask")
api.subscribe(api.Contracts.Futures["TXFC0"], quote_type="tick")

Subscribe to real-time market data. Pass a contract into the subscribe function and specify a quote_type to begin receiving streaming data.

Place Order

contract = api.Contracts.Stocks["2890"]
order = sj.StockOrder(
    price=9.6,
    quantity=1,
    action=sj.Action.Buy,
    price_type=sj.StockPriceType.LMT,
    order_type=sj.OrderType.ROD,
    order_lot=sj.StockOrderLot.Common,
    account=api.stock_account,
)
trade = api.place_order(contract, order)

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.

Cross-language

Start the Server

shioaji server start

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.).

Verify that the server has started successfully:

curl http://localhost:8080/api/v1/health

Getting Started

Once the server is running, the following entry points are available:

Purpose URL
Dashboard (live monitoring & management) http://localhost:8080/
OpenAPI document (browse API, run tests in-browser) http://localhost:8080/docs
Custom apps (entry point for self-uploaded web apps) http://localhost:8080/apps/<name>/

Open /docs to browse all endpoints, inspect request/response schemas, generate code samples in multiple languages, and test directly from the browser.

Custom Web Apps

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>/.

  • Supported formats: a single HTML file, or a build output folder from frontend frameworks such as Vite / React / Vue (containing index.html).
  • Upload steps: log in to the Dashboard → click Custom Apps → Upload → select the file or folder → set the application name <name>.
  • Project template: @sinotrade/create-shioaji-app — scaffolds a Shioaji frontend project with one command.

CLI

The shioaji CLI provides direct server management, market data queries, and order placement.

shioaji --help        # list all commands
shioaji tree --all    # show full command tree (with parameters and descriptions)

Server Management

Purpose Command
Start HTTP server (simulation mode) shioaji server start
Start HTTP server (production mode) shioaji server start --production
Check mode and authentication status shioaji server check
Show daemon status shioaji server status
Stop daemon shioaji server stop

Conclusion

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.

For more usage details, see

doc

Communication

Telegram Discord

Releases and Contributing

Shioaji has a 14 day release cycle. See the release change log. Please let us know if you encounter a bug by filing an issue.

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.

The Team

Shioaji is currently maintained by Sally, Yvictor, Zecheng and Po Chien Yang with major contributions.

Release files for shioaji 1.7.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for shioaji 1.7.6
File
shioaji-1.7.6-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details
shioaji-1.7.6-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details
shioaji-1.7.6-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details
shioaji-1.7.6-cp314-cp314t-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64 Details
shioaji-1.7.6-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
shioaji-1.7.6-cp37-abi3-manylinux_2_28_aarch64.whl CPython 3.7 abi3 Linux glibc 2.28+ ARM64 Details
shioaji-1.7.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
shioaji-1.7.6-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details
shioaji-1.7.6-cp37-abi3-macosx_10_15_x86_64.whl CPython 3.7 abi3 macOS 10.15+ x86-64 Details

Total release size: 391.5 MB

Release files / shioaji-1.7.6-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL shioaji-1.7.6-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 42.5 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a14dc7c8d28b145f07f235e97fa37edd4768df969c50b2244f811f8622be5225
BLAKE2b-256 checksum
How to use checksums
d6e780a076d040f4ed4aad0f2ead90c78eecff0f27cf2a29b66a322549864734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL shioaji-1.7.6-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 45.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b09ee0b8ea415003196ec6acff57486208407ca3440b3b56fda0ef0c90b0f121
BLAKE2b-256 checksum
How to use checksums
1ed616eacc96a6d9fec69a27fb5704011cf51b91600ecf9394a1c0062d69c66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp314-cp314t-macosx_11_0_arm64.whl

Download URL shioaji-1.7.6-cp314-cp314t-macosx_11_0_arm64.whl
Size 40.3 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1056350cdd40ed8f2fe24c6f95cad5c2007db5d97a92d1d6954ed02d37ce02d5
BLAKE2b-256 checksum
How to use checksums
c8f4b8c52523f7d2eeeba5c71fa0bac432e1b3382418a7e9653fb47389a95ca3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp314-cp314t-macosx_10_15_x86_64.whl

Download URL shioaji-1.7.6-cp314-cp314t-macosx_10_15_x86_64.whl
Size 43.6 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
290b3e0ec89b9d290e9763eab1da9420b5516ba23f9e5c1cbc9b84757c49d23f
BLAKE2b-256 checksum
How to use checksums
2062d3f49d32aecd712c13c2cd9a2a311157cd0544686f43ba0baccc04ee7949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp37-abi3-win_amd64.whl

Download URL shioaji-1.7.6-cp37-abi3-win_amd64.whl
Size 47.8 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
008930d556cf974edb1e2538e2f4d811c851e68de7376e2d133f27665df25625
BLAKE2b-256 checksum
How to use checksums
0801c8ac39c3eb8fe390a6b0c523573def88fc979ff154df0c4d50a9eed7d0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp37-abi3-manylinux_2_28_aarch64.whl

Download URL shioaji-1.7.6-cp37-abi3-manylinux_2_28_aarch64.whl
Size 42.5 MB
Tags CPython 3.7 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
63d289d1e780cb54b4336d5aa8fbe31544d358e94161c1cff921d6df6e635dc1
BLAKE2b-256 checksum
How to use checksums
f8a9c4fa28bd04c0a3618d03be7207c1d3643a88e3d1b65ae593bc8859624fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL shioaji-1.7.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 45.4 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e03d4c32fd509f53157649d489bbf6cdb2be31307ccb074e2fabcca6929dbf21
BLAKE2b-256 checksum
How to use checksums
eff59889f088cf2bc52a1501e2d45a8c71bf8b6dea6e67a95bc362b0729d4162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp37-abi3-macosx_11_0_arm64.whl

Download URL shioaji-1.7.6-cp37-abi3-macosx_11_0_arm64.whl
Size 40.3 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f9302252c57cd73e9f77a688e1278ed99c22dae411e5f49a138b52d71176357c
BLAKE2b-256 checksum
How to use checksums
82eb629fcc4f18298478897a07613c5638926b849027333669f3f6d4dd573ec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shioaji-1.7.6-cp37-abi3-macosx_10_15_x86_64.whl

Download URL shioaji-1.7.6-cp37-abi3-macosx_10_15_x86_64.whl
Size 43.6 MB
Tags CPython 3.7 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
fac223bf14c2d4f1a3488316b337a2fb3f08b6878f3ecd177bdb509127783531
BLAKE2b-256 checksum
How to use checksums
b91353e6533ae1004e949f152ef03fd58efad3fc3bc86d34e806f803888cdcb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.7.6 This release

9 release files

1.7.5

9 release files

1.7.4

9 release files

1.7.3

9 release files

1.7.2

9 release files

1.7.1

9 release files

1.7.0

9 release files

1.5.7

9 release files

1.5.6

9 release files

1.5.5

9 release files

1.5.4

9 release files

1.5.3

9 release files

1.5.2

9 release files

1.5.1

9 release files

1.5.0

9 release files

1.3.2

43 release files

1.3.1

43 release files

1.3.0

43 release files

1.2.9

43 release files

1.2.8

34 release files

1.2.7

34 release files

1.2.6

34 release files

1.2.4

26 release files

1.2.1

18 release files

1.2.0

18 release files

1.1.9

21 release files

1.1.8

19 release files

1.1.7

19 release files

1.1.6

21 release files

1.1.4

21 release files

1.1.2

21 release files

1.1.1

21 release files

1.1.0

21 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page