Skip to main content

Quick Start

Key points
  • This page provides Fubon Neo API login and order examples.
  • Complete Preparation first (account opening, certificate, agreement, and connection test).
  • See Installation and Version Compatibility for installation instructions and version compatibility.
ItemDetails
PrerequisitesPreparation completed
LanguagesPython / C# / JavaScript (Node.js) / C++ and Go (C++ and Go support securities trading, account information, and conditional orders only)
Download sourceSDK Download page
InstallationSee Installation and Version Compatibility
Next stepComplete the login and order example for your language

Complete the risk disclosure and certificate download in Preparation before you begin.

Installation and Version Compatibility

For installation steps and minimum version requirements, see Installation and Version Compatibility. Download SDKs from the SDK Download page.

Install Package

pip install fubon_neo-<version>-cp37-abi3-win_amd64.whl

And you should place the certificate in your folder structure like this:

.
└── XXXXXXXXXX.pfx

f you have never used the SDK for logging in or if you have changed your SDK execution environment, please create an index.py file in your folder and paste the following content into it, then execute it::

from fubon_neo.sdk import FubonSDK, Order
from fubon_neo.constant import TimeInForce, OrderType, PriceType, MarketType, BSAction

sdk = FubonSDK()

accounts = sdk.login("Your ID", "Your Password", "Your cert path" , "Your cert password") #If there are account groupings, multiple account information will be returned
## accounts = sdk.login("Your ID", "Your Password", "Your cert path") # If you use the "default" password for your certificate, for SDK v1.3.2 and newer versions

acc = accounts.data[0]

Send Order

Next, add the following example code to demonstrate how to use the Fubon API to place a limit order to buy 1 board lot of Fubon Financial Holding Co., Ltd. (2881) at the fall stop price.

order = Order(
buy_sell = BSAction.Buy,
symbol = "2881",
price = None,
quamtity = 2000,
market_type = MarketType.Common,
price_type = PriceType.LimitDown,
time_in_force= TimeInForce.ROD,
order_type = OrderType.Stock,
)
sdk.stock.place_order(acc, order)