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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

shioaji-1.7.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (45.1 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

shioaji-1.7.5-cp314-cp314t-macosx_11_0_arm64.whl (40.0 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

shioaji-1.7.5-cp314-cp314t-macosx_10_15_x86_64.whl (43.3 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

shioaji-1.7.5-cp37-abi3-win_amd64.whl (47.5 MB view details)

Uploaded CPython 3.7+Windows x86-64

shioaji-1.7.5-cp37-abi3-manylinux_2_28_aarch64.whl (42.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

shioaji-1.7.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (45.1 MB view details)

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

shioaji-1.7.5-cp37-abi3-macosx_11_0_arm64.whl (40.0 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

shioaji-1.7.5-cp37-abi3-macosx_10_15_x86_64.whl (43.3 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp314-cp314t-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 42.2 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.5-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6fe8dde7dbec4a95194fa4f2e7e6b1673acda7e3da11a8041715222ccd0e9986
MD5 3961d4949ee6bdaa3375a42f75a743ad
BLAKE2b-256 d8251bd33bfec56edecf5e7d37985f78b5006393c89217d1098000c63b7b9bae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 45.1 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.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0847934c2dd29bcc54fc9bf90bcdf21dc8dd100dea48d7d18ad35ca6539112e
MD5 fc31847a335a748abf5494d86a30e099
BLAKE2b-256 1be55c66691a36e50aac0ab534ba991af3ce07afbd38eb4f3b7c5d9241d6292c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp314-cp314t-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 40.0 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.5-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2e107e63024e49049aed6dbd69bf8b1f61d4a138b383f7e80e81f83c6ebff26
MD5 f95d58b4b2ed883439b899cb536ab7bc
BLAKE2b-256 3132af9c87107f944c2290c328b873c485214a5b143c633492b89d8e019e99d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp314-cp314t-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 43.3 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.5-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ef8f906a2a0ae45de3c62dcaa8247057135a940f1978454f91cec4095d77c990
MD5 4678045f3fe2d6eaca9ec22ea667d93f
BLAKE2b-256 f83efcbc316e8ded3856a32ac38c11a4e158722dff6ae9eca60e2d8ec65ee1b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 47.5 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.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f71dcbf88400d1d1adae8dbf66c5a869ffc639b3869d8cfaed30574f315d9c6a
MD5 1970b98a80ccbc474c8dd61f1f65d47e
BLAKE2b-256 53c02e055e5936949f29b344fd0515eec5b5c204bfcdba2f7b4202badb425931

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp37-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 42.2 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.5-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8814ebbdaaf0d3a1048d201695b5e678a6a12a1e2b5872051575a7bf2a06ece0
MD5 5a299153c0752647a6ebd481b914bb26
BLAKE2b-256 ce1eb510923ff360db0e2d42b50173e04cfa53299fc8bbd76cb7403d19e42c4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 45.1 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.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4aefd260a393ce3b4aea82b90cc2f76effbf2d4f0464af29466c5e8b27c6425d
MD5 47336f5b0a0241697205017fdc06c359
BLAKE2b-256 600ef223a06fbc8dfdcf610e4323c1f8ac73de7801e19f6ab63970b15882c4f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 40.0 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.5-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b6e776ee01e20c5aab3cbfa7e27673f490cc1b98c011f5d4cb61cb52bd267d6
MD5 0648a1dfb9099b5700c76637dcb9192d
BLAKE2b-256 66757a461c581a5589eb0d595ea996e59430856b993192bbf0a554a55797ebf5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shioaji-1.7.5-cp37-abi3-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 43.3 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.5-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b8bba2a04cac2efd6e8f9ca9b5f6045d2508fcda2ef3aa1000987b57ac92e9d3
MD5 2c9fd881fffd9fe410f5f831d1c58667
BLAKE2b-256 fc01d807bdef1575ca29516c04af649ae7dfcd0784c90b5cfbcaa5bd9af3810b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.7.5 This release

9 files

1.7.4

9 files

1.7.3

9 files

1.7.2

9 files

1.7.1

9 files

1.7.0

9 files

1.5.7

9 files

1.5.6

9 files

1.5.5

9 files

1.5.4

9 files

1.5.3

9 files

1.5.2

9 files

1.5.1

9 files

1.5.0

9 files

1.3.3

43 files

1.3.2

43 files

1.3.1

43 files

1.3.0

43 files

1.2.9

43 files

1.2.8

34 files

1.2.7

34 files

1.2.6

34 files

1.2.5

26 files

1.2.4

26 files

1.2.3

22 files

1.2.2

18 files

1.2.1

18 files

1.2.0

18 files

1.1.13

21 files

1.1.12

21 files

1.1.11

21 files

1.1.10

21 files

1.1.9

21 files

1.1.8

19 files

1.1.7

19 files

1.1.6

21 files

1.1.5

21 files

1.1.4

21 files

1.1.3

21 files

1.1.2

21 files

1.1.1

21 files

1.1.0

21 files

1.0.0

18 files

0.2.1.dev3

9 files

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