Skip to main content

Preparation

Key points
ItemDetails
ProductFubon Neo API
RequirementsFubon Securities account, digital certificate, API agreement, and connection test
Supported platformsWindows / macOS / Linux
LoginCertificate login
Next stepInstallation and Version Compatibility / Quick Start
caution

Before starting with the Fubon Neo API, you must complete the following steps:

  1. Have your Fubon Securities account ready. If you do not have one, open an account online.
  2. Apply for a certificate.
  3. Sign the API risk disclosure and agreement: Online signing guide, then complete the API connection test by logging in with the SDK (Windows, macOS, or Linux).

Prepare Your Fubon Securities Account​

If you already have a Fubon Securities account, please skip this step. If you don’t have a Fubon Securities account, please open an account now.

Your Fubon Securities account

Apply for a Certificate​

You can apply for a certificate in either of the following ways:

  • Apply and export on the web (Windows, macOS, or Linux): log in to Key Management and Certificate Export to apply for a web certificate and export it (supported since SDK v2.2.8). macOS and Linux users should use this method.
  • Certificate Manager (Windows): go to Certificate Application and Renewal, select Run now, and download Fubon Securities Certificate Manager (TCEM.exe) to apply for a certificate (expand the steps below).
Certificate Manager application steps (Windows)

Certificate apply

After you log in and complete authentication, enter your mobile number or email address to receive the OTP verification code.

OTP

After the application is complete, the certificate is stored in C:\CAFubon\\(your ID number) and uses your ID number as its filename.

CertLocation

Sign the API Risk Disclosure and Agreement, Then Test the Connection​

Sign Online​

Use the following guide to sign the API agreement and test the API connection. Online Signing Guide

Sign the agreements online

Connection Test​

Logging in once with the Fubon Neo API completes the test (Windows, macOS, or Linux). Windows users can also download the connection test helper.

Connection Test Helper

Installation and Version Compatibility​

Read Installation and Version Compatibility to confirm the minimum version and installation method for each language, then download the installer from SDK Download.

Start Your Program Trading Journey​

Use the following console command to install the SDK (please be advised that modify the .whl filename to the corresponding version downloaded).

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

<platform>: win_amd64 (Windows), macosx_11_0_arm64 (macOS Apple Silicon), macosx_10_12_x86_64 (macOS Intel), manylinux_2_17_x86_64.manylinux2014_x86_64 (Linux x86-64), manylinux_2_17_aarch64.manylinux2014_aarch64 (Linux Arm64)

Support Python version 3.7 (~v1.3.2) and 3.8–3.13 (v2.0.1~)

C# develop .NET Standard 2.0 for the base , Suggest using .netcoreapp 3.1 and above; If using .NET Framework,suggest using .NET Framework 4.7.2 and above.

Start Your Program Trading Journey​

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

# Connect and login
sdk = FubonSDK()

accounts = sdk.login("Your ID", "Your Password", "Your cert path", "Your cert password")
## 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]

# Create order object
order = Order(
buy_sell = BSAction.Buy,
symbol = "2881",
price = "66",
quamtity = 2000,
market_type = MarketType.Common,
price_type = PriceType.Limit,
time_in_force= TimeInForce.ROD,
order_type = OrderType.Stock,
user_def = "From_Py"
)

# Place an order
order_res = sdk.stock.place_order(acc, order)
print(order_res[0])

Congratulations 🎊 after placing your order, you will be able to see the system's response.

Result { is_success: True, message: None, data : { date: "2023/10/13", seq_no: "00000000015", branch_no: "6460", account: "26", order_no: "bA626", asset_type: 0, market: "TAIEX", market_type: Common, stock_no: "2881", buy_sell: Buy, price_type: Limit, price: 66.0, quantity: 2000, time_in_force: ROD, order_type: Stock, is_pre_order: false, status: 10, after_price_type: Limit, after_price: 66.0, unit: 1000, after_qty: 2000, filled_qty: 0, filled_money: 0, before_qty: 0, before_price: 66.0, user_def: "From_Py", last_time: "16:48:09.247", error_message: None} }