Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

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.

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

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,
    time_in_force=sj.TimeInForce.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.

Metadata

Release files for shioaji 1.8.0b3

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.8.0b3
File Actions
shioaji-1.8.0b3-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details for shioaji-1.8.0b3-cp314-cp314t-manylinux_2_28_aarch64.whl
shioaji-1.8.0b3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details for shioaji-1.8.0b3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
shioaji-1.8.0b3-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for shioaji-1.8.0b3-cp314-cp314t-macosx_11_0_arm64.whl
shioaji-1.8.0b3-cp314-cp314t-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64 Details for shioaji-1.8.0b3-cp314-cp314t-macosx_10_15_x86_64.whl
shioaji-1.8.0b3-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details for shioaji-1.8.0b3-cp37-abi3-win_amd64.whl
shioaji-1.8.0b3-cp37-abi3-manylinux_2_28_aarch64.whl CPython 3.7 abi3 Linux glibc 2.28+ ARM64 Details for shioaji-1.8.0b3-cp37-abi3-manylinux_2_28_aarch64.whl
shioaji-1.8.0b3-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details for shioaji-1.8.0b3-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
shioaji-1.8.0b3-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details for shioaji-1.8.0b3-cp37-abi3-macosx_11_0_arm64.whl
shioaji-1.8.0b3-cp37-abi3-macosx_10_15_x86_64.whl CPython 3.7 abi3 macOS 10.15+ x86-64 Details for shioaji-1.8.0b3-cp37-abi3-macosx_10_15_x86_64.whl

Total release size: 242.4 MB

Release files / shioaji-1.8.0b3-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL shioaji-1.8.0b3-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 15.0 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9afaa9c273cca6a5efbb11f7127b6dc72aab352f02d56d858585da8b980de8d5
BLAKE2b-256 checksum
How to use checksums
dc8913a62dcc5d1e3b7fb79841cf4842156feba71553fccf7094b2dedfb462a7
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.8.0b3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL shioaji-1.8.0b3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 15.7 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a3001fea14140ed4b523059e77f74d38ee16c5345fc6ace1cc0f8b56512fd7aa
BLAKE2b-256 checksum
How to use checksums
2272b195461cce6ccc6705dcf6a6d42a599aefd528e4060edf199792f863d3d9
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.8.0b3-cp314-cp314t-macosx_11_0_arm64.whl

Download URL shioaji-1.8.0b3-cp314-cp314t-macosx_11_0_arm64.whl
Size 14.0 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
46f2dbcba1f3d3083a0cc2044b12373bcffd38023162cfa463f2809d84e7e08f
BLAKE2b-256 checksum
How to use checksums
e765997d3c0f9026c9345d97839fcc6280574aac1b9db876e3a58d3c57082ae6
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.8.0b3-cp314-cp314t-macosx_10_15_x86_64.whl

Download URL shioaji-1.8.0b3-cp314-cp314t-macosx_10_15_x86_64.whl
Size 15.1 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
59aa601a607814b5e77dff5425c294d2c2da27cda46a2c22694ea21badebd9aa
BLAKE2b-256 checksum
How to use checksums
81265912f6b92df38ae93e933fae35c482b1417e6bea20f131f392baf40af5ee
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.8.0b3-cp37-abi3-win_amd64.whl

Download URL shioaji-1.8.0b3-cp37-abi3-win_amd64.whl
Size 39.6 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a48f06285bf861aa41cc474291547c8e4d016057089f9fd737d9b98208d5d241
BLAKE2b-256 checksum
How to use checksums
fa5c6e7c00392064e7c8c71fe183c6b5060736b7de093b8211135ed220c4daad
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.8.0b3-cp37-abi3-manylinux_2_28_aarch64.whl

Download URL shioaji-1.8.0b3-cp37-abi3-manylinux_2_28_aarch64.whl
Size 35.6 MB
Tags CPython 3.7 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c165552bdd0e8ae96f5e691ab9b374d3712c8d73cc0d8ce7ddbc0bb3c59b9fd7
BLAKE2b-256 checksum
How to use checksums
bc0e2eaf4d85fca7089fe0dd7e63ea944284d9592c528a0365d03d498c719a8a
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.8.0b3-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL shioaji-1.8.0b3-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 37.7 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
08d0a3848e2743af312ffcbd339396a14c5d01eb1dd13906581c99983c50fa0e
BLAKE2b-256 checksum
How to use checksums
787a28c395cf04529cc1deaa010127e567130071153012937cfbc68e858bc6a6
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.8.0b3-cp37-abi3-macosx_11_0_arm64.whl

Download URL shioaji-1.8.0b3-cp37-abi3-macosx_11_0_arm64.whl
Size 33.6 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b2a4136a24734710e974d868f271d952b1a574f1c78a487f2ef18f5a8d03f262
BLAKE2b-256 checksum
How to use checksums
14e250ac53a654fbb8b252f1d677fbde5366d6e854a760895590ea3dda7e2ce7
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.8.0b3-cp37-abi3-macosx_10_15_x86_64.whl

Download URL shioaji-1.8.0b3-cp37-abi3-macosx_10_15_x86_64.whl
Size 36.2 MB
Tags CPython 3.7 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
b3a159a00c05a16ea53fed447d914a98338672975b38104dfc4bde9e6378a0db
BLAKE2b-256 checksum
How to use checksums
8b2b3a07d67d4c5ec8460e7c6c7a515ffcd582b359877e5a77c2292e95f03d01
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}

Security for shioaji 1.8.0b3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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