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://raw.githubusercontent.com/sinotrade/shioaji/master/install.sh | sh

# Pre-release
curl -fsSL https://raw.githubusercontent.com/sinotrade/shioaji/master/install.sh | CHANNEL=prerelease sh

# Specific version
curl -fsSL https://raw.githubusercontent.com/sinotrade/shioaji/master/install.sh | VERSION=v1.5.0 sh

Windows (PowerShell):

# Stable
irm https://raw.githubusercontent.com/sinotrade/shioaji/master/install.ps1 | iex

# Pre-release
$env:CHANNEL="prerelease"; irm https://raw.githubusercontent.com/sinotrade/shioaji/master/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.2

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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

shioaji-1.5.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (37.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

shioaji-1.5.2-cp314-cp314t-macosx_11_0_arm64.whl (33.4 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

shioaji-1.5.2-cp314-cp314t-macosx_10_15_x86_64.whl (36.2 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

shioaji-1.5.2-cp37-abi3-win_amd64.whl (39.8 MB view details)

Uploaded CPython 3.7+Windows x86-64

shioaji-1.5.2-cp37-abi3-manylinux_2_28_aarch64.whl (35.4 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

shioaji-1.5.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (37.8 MB view details)

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

shioaji-1.5.2-cp37-abi3-macosx_11_0_arm64.whl (33.4 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

shioaji-1.5.2-cp37-abi3-macosx_10_15_x86_64.whl (36.2 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp314-cp314t-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 35.4 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.2-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7dd48706461d4f52a69d600149b074fd99de7100b7e551c17062a379d5c39e27
MD5 3bd895ea87d06d3a688ca41b553907d4
BLAKE2b-256 3fe70d14bd9c7394bee6146f503fa114039ff4f6938495f2bb6508a239b43661

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 37.8 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.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06ab1cc321cf7a5e053f143a6fb33f268e5e0477d9fec8bc17098c6517eaf72e
MD5 12dd4a2ebadaa8cad347a89af191959c
BLAKE2b-256 e390c9b693de2713929db7305aded53979f47ba6c5a88f59f3e200100e30e868

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp314-cp314t-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 33.4 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.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc2fdd425785d620e0a4febeb496394610002963fd017b594cdc66cc6feb8ab5
MD5 77a007501ba547efa26cb3ac811c1161
BLAKE2b-256 efa1f8f0b5944a1e05aff4ec8cec04ff12bc3f1da7b4ce1cb5e3c7e91b098e35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp314-cp314t-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 36.2 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.2-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 949683eb774de07f11c97eeec9627b6e4a799313b2b624ed131e2f41cc104043
MD5 04fa340d8178ce07edfb4de2f5591f52
BLAKE2b-256 21091e90ddcbf499814d4c124cec9bfb35a11e8c82e8a3aab2c20024bfe3ea44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 39.8 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.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5c0c1fb26133c25d0772447cf66242a0dc94ccb7df22108e79a81662dc6f3205
MD5 9391bfd74b95a833ddf3cc7d901a5d58
BLAKE2b-256 1caeba939078ae0535a0a06e0feb6252274df276c2032d6ac5f4adb78fd99f7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp37-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 35.4 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.2-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e0aa47edc8ef686d44f1a43ad1e42482ad3f291de2ccb07818cca62ad7134b1a
MD5 e4e5f6d932cd622fab7d6b8068cc9081
BLAKE2b-256 de4a70613ffde7b640cb7ca66d97fdb6a3ca5137aa9069a70d59afca52a846ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 37.8 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.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3710997deafbf3df02413c0bcb80b8d9d5e538ace3d619cb59f7544684db082c
MD5 6a00101b93d209d397ac067fa2647485
BLAKE2b-256 5582631c7ecde4453bbcdd7656970e98403529de1367f663f00f8dfd91b9447a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 33.4 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.2-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61ffe62c42df9949182bc1f55a892c2831f9763f7da56cb6c989a4f8dcf804a0
MD5 55ab22a02ddcbdcf5664da5bc719aaed
BLAKE2b-256 6bb110f4cdc09cfb7710f2df9d0649f28c3769f3dcb101b7f2bf0e4b243d919c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.2-cp37-abi3-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 36.2 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.2-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 86d102d2ca20617820e3945723027b4cb68cfe27efe8daf2b57835e9e1e6e396
MD5 4a98ea62e382a34ade49451b569484b4
BLAKE2b-256 b115b474626d0638f7b842a8f34d3a00b5005a8815402130ec703b460fff62f9

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