- Tradernet API
- TN API news
-
List of fixes and updates
- Login
-
Login/Password
-
API key
-
Initial user data
-
User’s current session information
-
Public API client
-
Tradernet Python SDK
- of a security session
-
Get a list of open security sessions and subscribe for changes.
-
Open a security session with SMS
-
Open security session with Web Token
-
Open a security session with EDS
- Quotes and tickers
-
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
-
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
-
Feedback order
- 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
Get ticker data.
Description of server request parameters and a sample response:
Attention: All examples in the documents contain the data not carrying any actual information!
Method of obtaining historical information as per the listing (candlesticks).
Limit on inquiries per minute: Unlimited
HTTPS GET
HTTPS POST (For API V2)
Request:
{
"cmd" (string) : "getSecurityInfo",
"params" (array) : {
"ticker" (string) : 'AAPL.US',
"sup" (bool) : true
}
}
Base parameter | Parameter | Type | Description |
cmd | string | Request execution command | |
params | array | Request execution parameters | |
params | ticker | string | the name of the ticker, required to retrieve data from the server |
params | sup | bool | IMS and trading system format |
Response:
Getting a response if successful.
/**
* A sample response returned by the server, when requesting information about a ticker
* @param {number} id - Unique ticker ID
* @param {string} short_name - Short ticker name
* @param {string} default_ticker - Ticker name on the Exchange
* @param {string} nt_ticker - Ticker name in Tradernet system
* @param {string} first_date - Company registration date in stock exchange
* @param {string} currency - Currency of a security
* @param {number} min_step - Minimum price increment of a security
* @param {number} code - Code error
*/
{
'id' : 2772,
'short_name' : 'Apple Inc.',
'default_ticker' : 'AAPL',
'nt_ticker' : 'AAPL.US',
'firstDate' : '02.01.1990',
'currency' : 'USD',
'min_step' : 0.01000,
'code' : 0,
}
We get an answer in case of failure
// Common error
{
"errMsg" : "Bad json",
"code" : 2
}
// Method error
{
"error" : "User is not found",
"code" : 7
}
Examples of using
-
JS (jQuery)
This example was made using open source library jQuery/** * @type {getSecurityInfo} */ var exampleParams = { "cmd" : "getSecurityInfo", "params" : { "ticker" : "FB.US", "sup" : true, } }; function getSecurityInfo(callback) { $.getJSON("https://tradernet.com/api/", {q: JSON.stringify(exampleParams)}, callback); } /** * Get the object **/ getSecurityInfo(function(json){ console.log(json); });
-
PHP
This example is prepared using an open internal library. PublicApiClient for PHP$publicApiClient = new PublicApiClient($apiKey, $apiSecretKey, Nt\PublicApiClient::V1); $responseExample = $publicApiClient->sendRequest('getSecurityInfo', ['ticker'=> 'AAPL.US', 'sup' => true], 'array');
-
Python
This example is prepared using an open internal library. PublicApiClient for Phytoncmd_ ='getSecurityInfo' params_ = { 'ticker': 'AAPL.US', 'sup': True } res = NtApi.PublicApiClient(pub_, sec_, NtApi.PublicApiClient().V1) print(res.sendRequest(cmd_, params_).content.decode("utf-8"))