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 supportClaude 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 AppsUpload → 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shioaji-1.7.3-cp314-cp314t-manylinux_2_28_aarch64.whl (40.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

shioaji-1.7.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

shioaji-1.7.3-cp314-cp314t-macosx_11_0_arm64.whl (38.7 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

shioaji-1.7.3-cp314-cp314t-macosx_10_15_x86_64.whl (41.9 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

shioaji-1.7.3-cp37-abi3-win_amd64.whl (45.9 MB view details)

Uploaded CPython 3.7+Windows x86-64

shioaji-1.7.3-cp37-abi3-manylinux_2_28_aarch64.whl (40.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

shioaji-1.7.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

shioaji-1.7.3-cp37-abi3-macosx_11_0_arm64.whl (38.7 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

shioaji-1.7.3-cp37-abi3-macosx_10_15_x86_64.whl (41.9 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

File details

Details for the file shioaji-1.7.3-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp314-cp314t-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 40.9 MB
  • Tags: CPython 3.14t, manylinux: glibc 2.28+ ARM64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 046b7f9af6bc3d775693bb2a0931e8cca492538f6a4f11f9d3ae1ac26384e0e7
MD5 5cb1be3903784755d0f5187c198e56cf
BLAKE2b-256 d932c9b308f873d7d583e5440ba0d4ef995b8d18deee9b62eb16a235029c5bff

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 43.7 MB
  • Tags: CPython 3.14t, manylinux: glibc 2.17+ x86-64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c9227d5524fde70d465fb8ede05409a992925b9551cf190cb796f6d2608e5a0
MD5 90ae7cf4863df45651e3d16ac30fa5ef
BLAKE2b-256 9a902c0fe47bbfc3af30e008db73cdcac625a4f4d4c0f4f95827fb2fa1089b22

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp314-cp314t-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 38.7 MB
  • Tags: CPython 3.14t, macOS 11.0+ ARM64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91833a0d18a7081da866dbb57e8c382d862b23a4260918e0b002c3b6876eb274
MD5 dec67270d7dd2d967bb681627107d7a9
BLAKE2b-256 fa77c7670b0ec102c5296a1bd37e3c3877f040df35201e746c848b5b51003b68

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp314-cp314t-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp314-cp314t-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 41.9 MB
  • Tags: CPython 3.14t, macOS 10.15+ x86-64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 06953bf9f252149be33986650152d790d758217ecc4fe4decc54360e6b01f082
MD5 2e703965521ac36e5514a3050dd7dc8f
BLAKE2b-256 37851d4f84255db0943c72418cdb8595978f33550ce1cffedb3d470f173a7b41

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 45.9 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 02d1b71aabccec8e5911d71d0f52c7937bf3f22994d1fb20f7d9ace65830dd0c
MD5 89f1c0ca514277a90d36fa2939f1e8e2
BLAKE2b-256 28fba9af1ae2b81372548e29aac4d55386062ccb4a1920985838903ee6fa3510

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp37-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 40.9 MB
  • Tags: CPython 3.7+, manylinux: glibc 2.28+ ARM64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0c476db255d8a8838bd27a631a3fa34f85b8c47ff22d404c4c4d3d685571b09c
MD5 de679e7d40d824c5960d21868ee474b9
BLAKE2b-256 49cd5e1a27c06ed661e554f67f48c0f3ed68baac079689e9a5d025bdbc0d15e3

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 43.7 MB
  • Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb08c627becb73abada9a5bcc7ef866aaf028040ac0704d6d3fb91ef744f0879
MD5 eed636f76d4003e1e5edf25f48368fd0
BLAKE2b-256 c7fbc06e0ff59ba20dde27ebf147ed263763c35331f072bb5e81021dee093220

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 38.7 MB
  • Tags: CPython 3.7+, macOS 11.0+ ARM64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c685855f55514814f523242d453414e258be15c9be2d754d4afa86f828f61ede
MD5 5e74c1d32c941b6b5531f8c0fc52e2dd
BLAKE2b-256 52c73f241f797f5c6f6db8a809cab5f584d05ab28ca3d1f782091b2de24302ce

See more details on using hashes here.

File details

Details for the file shioaji-1.7.3-cp37-abi3-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: shioaji-1.7.3-cp37-abi3-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 41.9 MB
  • Tags: CPython 3.7+, macOS 10.15+ x86-64
  • Uploaded using 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}

File hashes

Hashes for shioaji-1.7.3-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7a917da7cea77dbe7954d452174e12e9671a06fa3d65fa11fd0dbc5b67521c4e
MD5 267ae87e41738148ec345dff241f8576
BLAKE2b-256 9c69e61c2dde258eb976bfcd5740e10be0d56dc22ede282d87da6b2fb90038a9

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page