Preparation
Environment requirement
- Operation system requirement:
- Windows
- MacOS
- Linux
- Solaris
- Programming language: Python 3.4 or later
Install Python
To minimize compatibility issues, we recommend you to install the latest version of Python. Versions earlier than Python 3.4 may not work properly. You can type 'python3 -v' in the console for a version check or a installation verification.
Install latest version python:
Visit the Download page of the Python website: https://www.python.org/downloads/
Select the operating system, download the installation package, and install it as prompted
Install Tiger Open API Python SDK
Method 1:Use pip to install(Recommended)
In Terminal or CMD, enter the following command:
$ pip3 install tigeropen
to install Tiger Open API Python SDK.
If need to upgrade the version, can use:
pip3 install tigeropen --upgrade
remark:
If pip official repository is slow, can change another mirror, like:
pip install tigeropen -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip3 install tigeropen -i https://pypi.tuna.tsinghua.edu.cn/ --trusted-host pypi.tuna.tsinghua.edu.cn
Method 2:Github
The source code of the OpenAPI SDK project is posted on Github,The Github address is:
https://github.com/tigerfintech/openapi-python-sdk
How to install:
clone the project into local dirctory
run the setup.py in the directory, using the following command:
python3 setup.py install
Install IDE
We recommend using pycharm as your IDE
Official Download Page:
https://www.jetbrains.com/pycharm/download/
Registered Developer Information
Before using the API, please first click the link to visit the official website of Tiger Quantification to open the permission and register the developer identity:https://developer.itigerup.com/profile,Please use Chrome for this page
To access the Open API, you need to Open a tiger account and Funded.
During the registration process, you will be asked to sign an API authorization agreement, after that, you need to fill in your prefered accoount configuration and click "update", you will need to fill in the following information:
Title | Optional | Description |
---|---|---|
RSA public key | NO | Auto generate by API Website.The RSA pulic key ensures the security of your account, by RSA two-way signature mechanism,the keys protect the API request from being illegally changed. |
IP White List | Yes | Only IP addresses in the white list can access Tiger API,use “;” to divide multiple IPs |
Callback URL | Yes | customized callback URL of users's program, used for receive the message for update on order and account status, user can also use the callback function provided in the SDK to receive callback messages |
You can obtain the following information upon sucessful registration:
- tigerId: A unique Developer ID assgined by the OpenAPI platform. It is used to identify a developer,you have to pass in ID to use API.
- account: Account number,you will need to pass in your account number when you are calling trade related APIs。There are 3 types of accounts: global account, standard account and paper account.
- Global Account:a string beginning with capital letter U, example:U12300123,
- Prime Account:number(5 to 10 digit), example:51230321,
- Paper Account:17 digit number,example:20191106192858300,
Only active accounts with balance will be shown on the page, if an user has both active global account and standard account, they will both be shown on the developer info page.
Developer Register Page: Use your phone and verifyCode to register.
Developer Info Page: Tiger ID,Live Account,Paper Account,License Info will be used in SDK.
Attention:You need to keep the privateKey in the picture below locally and keep it properly to prevent leakage, please update it in time if you find leakage. The private key will not be saved on the Tiger server, users need to save it before refreshing the page. The private key will disappear automatically after the page is refreshed. If the private key is not saved, you can replace it by re-generate
button.
Users can save the corresponding type of RSA privateKey according to different SDK call requirements.
RSA Keys
The Tiger Open API uses RSA for authentication. RSA encryption is used to secure user interface requests. The RSA bidirectional signature authentication mechanism is used to prevent interface requests from being maliciously tampered. The private key is saved locally by the user.
Attention:
- The Java private key format is different from that used by the Python SDK. The Python private key format is PKCS#1. If any problem occurs when you use the SDK, please check whether the private key is in the correct format first
Subscribing to Market Data (Optional)
We offer our users free access to delayed market data for the U.S market. Our customers from Mainland China will also get free Level 2 Quote Subscription for HK market. Live quotes and historical data are also available for a fee. Please note that Open API is an independent service from our APP, and API data need to be purchase seperately. Please follow the instructions below to subscribe market data for API:
Individuals
1.Login Personal Center to purchase quote.
2.Go to Tiger Trade APP - Profile- Market Data Store- OpenAPI and select from the subscription list shown on this page
Institutional user
Go to Tiger Brokers Institutional Account Center - Market Data and subscribe