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

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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

shioaji-1.5.1-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.1-cp314-cp314t-macosx_11_0_arm64.whl (33.4 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

shioaji-1.5.1-cp314-cp314t-macosx_10_15_x86_64.whl (36.1 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

shioaji-1.5.1-cp37-abi3-win_amd64.whl (39.7 MB view details)

Uploaded CPython 3.7+Windows x86-64

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

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

shioaji-1.5.1-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.1-cp37-abi3-macosx_11_0_arm64.whl (33.4 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

shioaji-1.5.1-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.1-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c13217d9852b2744311e8c0ebacb5b3a0961ad08520a352c4eafbca95e266aeb
MD5 7d045a514209b25c0f7a4ddd1cc2c53d
BLAKE2b-256 399c9114b3d9bdc16ffa9e237b44c46be8eb31cc28442a6c4d6249117f02d0e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1db9f4ac469e54fe16d8f0d93433a2220a284b98b3e2534a9472723e645d1065
MD5 e2c5c110d94eefef98b9bc5b46bae352
BLAKE2b-256 f9b8ae4a02ce5feca2c08363a17b30fe0db27f7b089f64094596207fed13c99b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a26488b899c9cddcb4ed0bf40c62a5cf03c1867281b055183d927d62a843328
MD5 4294dafdb19f51f4a1ee9a5c50de6118
BLAKE2b-256 b260511fa707a84f0a52bae5a04231dc770bb4c90cd533703561f5e390b0b6f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-cp314-cp314t-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 36.1 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.1-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2380994d0f4bd896041d666a73bc8169615ad059599183fc478bb3928783dd50
MD5 e9f9408e1a2958679d1579c0b1a5f0a7
BLAKE2b-256 6ecf72e003b8973939fa3ea003ccd4ca77a642d0feed6cbd65426a66de48e649

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 39.7 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.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 116af6e3567f5380a7d6112749b1d5e93673ec00ee123d7f740d37ea087da511
MD5 0c27ca3811fddb6fa7ee1afef0e7b0c1
BLAKE2b-256 d53b5092aeb22b97ed5de94ed0013f16dfd5fdcfe814882e0722ab15852f5635

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4ea14e9d683a892fd63ad8498d25dec290468c538b2588c37b3c8e5818b80c1e
MD5 6c0a9df14e5484c45ce29b8e02a8002e
BLAKE2b-256 b0c1033d953cb9b67b4cf2caa657bfd269b0996f66e6558b0e3260bd883be594

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f5a6b77ebdc961cd1ac1203fd07140fdd3837750471615103d8e74216585b20
MD5 e27245b5f8cd9cbb0c9e547d8165276a
BLAKE2b-256 7251cd4595d2052c544fa230be83b70b5c2030ce435d75eed3282c9c906a264b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9b6c6e0286b3cf43433224108d374dcdfaf316dd51d5b53523b0f6054e542ff
MD5 b8fb1969842c91b03ca228b5a5b42132
BLAKE2b-256 f5763996e79bf732975c8edc392cc093d4df0853c4cf79c1e57e41f6314c34e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.5.1-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.1-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b4c44d0290ce565a9fde1e17764bec821f23754641f1643dcbafc0b19f3649da
MD5 1e81c359ce8a0b033b30ffc4fa597c40
BLAKE2b-256 e96fc1cb68dae091d8947eed2d7726ebabd6c4086347345d5d1a65f95f72c1d8

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