- Tradernet API
- TN API news
-
List of fixes and updates
- Login
-
Login/Password
-
API key
-
Initial user data
-
User’s current authorization session information
-
Public API client
-
Tradernet Python SDK
- of a security session
-
Get a list of open security sessions and subscribe for changes.
-
Opening the security session
- Set up the list of securities
-
Receiving the lists of securities
-
Adding the list of securities
-
Changing the list of securities
-
Deleting the saved list of securities
-
Setting the selected list of securities
-
Adding the ticker to the list
-
Deleting the ticker from the list
- Quotes and tickers
-
Get updates on market status
-
Get stock ticker data
-
Options demonstration
-
Getting the most traded securities
-
Subscribe to stock quotes updates
-
Get a quote
-
Subscribe to market depth data
-
Get quote historical data (candlesticks)
-
Get trades
-
Retrieving trades history
-
Stock ticker search
-
News on securities
-
Directory of securities
-
Checking the instruments allowed for trading
- Portfolio
-
Getting information on a portfolio and subscribing for changes
- Orders
-
Receive orders in the current period and subscribe for changes.
-
Get orders list for the period
-
Sending of order for execution
-
Sending Stop Loss and Take Profit losses
-
Cancel the order
- Price alerts
-
Get current price alerts
-
Add price alert
-
Delete price alert
- Requests
-
Receiving clients' requests history
-
Receiving order files
- Broker report
-
Receiving broker report
-
Getting the broker's report via a direct link
-
Obtain a depository report
-
Obtain a depository report via direct link
-
Money funds movement
- Currencies
-
Exchange rate by date
-
List of currencies
- Websocket. Real-time data
-
Connecting to a websocket server
-
Subscribe to stock quotes updates
-
Subscribe to market depth data
-
Subscribing to changes in security sessions
-
Subscribe to portfolio updates
-
Subscribe to orders updates
-
Subscribing to changes in market statuses
- Various
-
List of existing offices
-
Name list of the system files
-
Trading platforms
-
Instruments details
-
List of request types
-
A list of the user's profile fields
-
Types of documents for the application
-
A list of the codes and errors
-
Orders statuses
-
Security
-
Types of valid codes
API key
1. After a pair of API keys has been created, the client may, using the Tradernet API methods, exploit the platform's trading functionality without opening a security session by SMS - the session is opened when the server is correctly accessed using the key.
2. If a pair of individual API keys is transferred to a third party, all responsibility rests with the client, in the Account of which the pair of API keys was generated.
To use Tradernet online trading system, you need a pair of keys to sign outbound messages.
Using an API key, you can access API v2 commands (for a complete list of available commands, refer to Public API client section)
The main purpose of v2 is to make the platform's trading functionality available without opening a security session by SMS - the session is opened when the server is correctly accessed using the key.
Signature generation for sending a request WITHOUT using the PublicApiClient library, which we recommend to use for most clients
1. All requests are sent in POST format.
2. All requests are sent to the endpoint URL for API V2: tradernet.com/api/v2
3. All requests must contain an X-NtApi-Sig title, which is the message signature.
3.1 The signature is calculated using the sha256 algorithm, where the string of the form key = value & key2 = value2 is used as the signature line.
3.2 Used as a key for generating the signature is a secret API key, which can be generated at «Tradernet API» → «API key»
3.3 Test signature. Suppose you have an array of data that you want to send, and a secret key:
$aQ = ['key'=>'value', 'key2'=>'value2'];
$API_SECRET = '123';
The string for forming a signature will look like this:
key=value&key2=value2
Creating signature:
sign = hash_hmac('sha256', 'key=value&key2=value2', '123')
Signature and request header will be equal to:
f2cbb400e9fcb40a1ab38cc987e2887ee88278731d83a4df4c65d38ae1d7cbee
X-NtApi-Sig: f2cbb400e9fcb40a1ab38cc987e2887ee88278731d83a4df4c65d38ae1d7cbee
4. Each request must contain mandatory parameter apiKey – user’s public API key
As an example, or to start working with the Tradernet API, you may examine our libraries posted on the page Public API client.