- 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
User’s current session information
Description of server request parameters and a sample response:
Attention: All examples in the documents contain the data not carrying any actual information!
The request enables receiving user’s current session information
Limit on inquiries per minute: Unlimited
HTTPS GET
HTTPS POST (For API V2)
Request:
{
"cmd" (string) : "getSidInfo",
"SID" (string) : "[SID by authorization]",
"params" (array) : {}
}
Base parameter | Parameter | Type | Description |
cmd | string | Request execution command | |
SID | string | SID received during the user's authorization | |
params | array | Request execution parameters |
Response:
Getting a response if successful.
{
"SID" (string) : "[SID by authorization]",
"user_id" (int) : 2011111110
}
We get an answer in case of failure
// Common error
{
"errMsg" : "Bad json",
"code" : 2
}
// Method error
{
"error" : "User is not found",
"code" : 7
}
Base parameter | Parameter | Type | Description |
code | int | Code error. The meaning of the codes can be viewed on the page "A list of the codes and errors" | |
errMsg | string | A description of general error. The meaning of the errors can be viewed on the page "A list of the codes and errors" | |
error | string | Error description | |
SID | string | Session ID or null if no active session is available | |
user_id | int | User ID |
Examples of using
This example was made using open source library jQuery
-
JS (jQuery)
/** * @type {getSidInfo} */ var exampleParams = { "cmd" : "getSidInfo", "SID" : "[SID by authorization]", "params" : {} }; function getSidInfo(callback) { $.getJSON("https://tradernet.com/api/", {q: JSON.stringify(exampleParams)}, callback); } /** * Get the object **/ getSidInfo(function(json){ console.log(json); });
-
PHP
/** * User’s session information receipt*/ $publicApiClient = new PublicApiClient($apiKey, $apiSecretKey, Nt\PublicApiClient::V2); $responseExample = $publicApiClient ->sendRequest( 'getSidInfo' );
-
Python
import PublicApiClient as NtApi pub_ = 'Your Api key' sec_ = 'Your Api secret' cmd_ = 'getSidInfo' res = NtApi.PublicApiClient(pub_, sec_, NtApi.PublicApiClient().V2) print(res.sendRequest(cmd_).content.decode("utf-8"))