Registry / finance / shioaji

shioaji

JSON →
library1.5.2pypypi✓ verified 83d ago

Shioaji is a cross-language, cross-platform universal trading API providing native Python bindings, HTTP API with SSE streaming, standalone CLI, and a visual dashboard. Current version 1.5.2, with regular updates focused on fixing bugs and adding broker support. Requires Python >=3.7.

pip install shioaji
INSTALL
IMPORT
SIG · SHIOAJI
S
shioaji
financepythonv1.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Shioaji
import shioaji as sj
from shioaji import Shioaji
Shioaji is a module, not a class; the main entry point is via sj.login()
Contracts
from shioaji.constant import Contracts
import shioaji.contracts
Contracts enum is in the constant module, not directly in contracts

Initialize Shioaji in simulation mode and log in using environment variables for credentials.

import shioaji as sj api = sj.Shioaji(simulation=True) # simulation mode for paper trading accounts = api.login( api_key=os.environ.get('SHIOAJI_API_KEY', ''), secret_key=os.environ.get('SHIOAJI_SECRET_KEY', '') ) print(accounts)
Debug
Known issues
gotchaShioaji has both simulation and real trading modes. Setting simulation=False or omitting simulation=True will connect to production servers, which may cause unintended real trades. Always explicitly set simulation=True for testing.
fix
Use api = sj.Shioaji(simulation=True) when testing or using paper trading.
affects: all
breakingIn v1.4.0, the login method changed its return type. Previously it returned a tuple, now it returns an Accounts object. Code expecting a tuple will break.
fix
Update code to handle Accounts object: accounts = api.login(...); account = accounts[0]  # or iterate
affects: >=1.4.0
deprecatedThe Shioaji constructor parameter 'simulate' was deprecated in 1.3.0 and removed in 1.4.0. Use 'simulation' instead.
fix
Use simulation=True instead of simulate=True.
affects: >=1.4.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'shioaji'
The package is not installed or the Python environment is incorrect.
fix
Run: pip install shioaji --upgrade
AttributeError: module 'shioaji' has no attribute 'Shioaji'
Incorrect import: trying to access Shioaji as a class directly from the module, but it's a class nested inside the package.
fix
Use: import shioaji as sj; api = sj.Shioaji()
shioaji.exception.LoginFailedException: Login failed. Check your API Key and Secret Key.
Missing or invalid API credentials.
fix
Ensure you set environment variables SHIOAJI_API_KEY and SHIOAJI_SECRET_KEY correctly. Check for typos or expired keys.
Upgrade
Version history
1.5.2latest on PyPI · released Jun 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
Resources

No resource links recorded.

shioaji — pip install shioaji · libregistry