Skip to main content

Shioaji — cross-language, cross-platform universal trading API. Native Python bindings, HTTP API with SSE streaming, standalone CLI, and a visual dashboard.

Project description

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

Project details


Release history Release notifications | RSS feed

This version

1.5.5

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.5.5-cp314-cp314t-manylinux_2_28_aarch64.whl (35.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

shioaji-1.5.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

shioaji-1.5.5-cp314-cp314t-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

shioaji-1.5.5-cp314-cp314t-macosx_10_15_x86_64.whl (36.7 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

shioaji-1.5.5-cp37-abi3-win_amd64.whl (40.4 MB view details)

Uploaded CPython 3.7+Windows x86-64

shioaji-1.5.5-cp37-abi3-manylinux_2_28_aarch64.whl (35.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

shioaji-1.5.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.4 MB view details)

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

shioaji-1.5.5-cp37-abi3-macosx_11_0_arm64.whl (33.9 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

shioaji-1.5.5-cp37-abi3-macosx_10_15_x86_64.whl (36.7 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp314-cp314t-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 35.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.5.5-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d9276beaeb0110a904e40724cdfd0e4bd88ae28934776c5d874a579ba3f97a79
MD5 1bbc2521ab94618dd05b7e56cf330333
BLAKE2b-256 9523a5e8a641e635474bba15a18268067a6ad9fce1f6448f67af66c60a946df3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 38.4 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.5.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e2a03193ec5e711f66ca8933feacb3dbf0c31c819ccf93f5103c45639cf344d
MD5 4905085d2780b038a8b8717dad4240a3
BLAKE2b-256 117d43fcdef60e94a65d12f1eafadbc57dd18915217d50766f8e482ab83c7799

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp314-cp314t-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 33.9 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.5.5-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc2bf630f62073fd50b8b19eab9f615d76e08b123dfb27071b9dbfa37ca5e4f3
MD5 b1b29e1ea2484d053d37fb5eb70d77e0
BLAKE2b-256 eb00ad4d42b2f6df9ba45b25eb3d64ceeea38e9b4e5bace591015a40f8f79300

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp314-cp314t-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 36.7 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.5.5-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7694e3b42447778521ebc9c9d1937b7c98ea537444985eb711a5934d84e00c2c
MD5 3e6abb187c7a940d96a5658ae019f9ed
BLAKE2b-256 3b1fbb3f7f760179f7867227314716f5b03ae16fe92cac48057e72aabf7a79e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 40.4 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.5.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4d67fa313ba09a392781ee9e5d0933f6d4e1439e5cdfe75722468a7dd912df8e
MD5 676b2e11d62f0c69bdd6f849c4ea4bba
BLAKE2b-256 84cd52341197cabd9f9b26088df12931e419170de79382aa70fdd0ae1e3fec2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp37-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 35.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.5.5-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 94505fad27f1aa1e59e950349597cb3b99a77b37f95e32c490d43062be55071c
MD5 a1830cf0b05c85e7a61a8e5953d1a83a
BLAKE2b-256 62dc3551bd983ab9435a56a9ed68772411f1eb41a05fdf435232dafa3e15cf66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 38.4 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.5.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c93583f84a96d968802e1d3bfb4609f43013134d1e988c40143e28ba316b95e1
MD5 d6acd37b90afdf0ab841abd8d7613f2b
BLAKE2b-256 0f76db4dac7252c27197a01d10a701fe2ff803d8d15cbf39cdd2c0c319ce7b7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 33.9 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.5.5-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8c1e4616ab9f6363ac5c242fddb999c5aeb49cf481a967887309d2de37e6712
MD5 f7f34f26a8352556b4c71d159c62f1f8
BLAKE2b-256 a5e2f5fe1ffe21d27a57e296ca3ae7ed76795e62d1e441716ebce3f6ec66c38c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.5-cp37-abi3-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 36.7 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.5.5-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 87492650e54c3818191ceaf05931c9e60c04e023db50c278fa55ad0b5c156659
MD5 17a07dbf04ab4f78611f66c573e727d3
BLAKE2b-256 ff537aa3582d3f25a47786920d59bac2123a58d001eebf0a9a89025f04f79dcc

See more details on using hashes here.

Supported by

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