Options demonstration

Description of server request parameters and a sample response:

Attention: All examples in the documents contain the data not carrying any actual information!

This methods allows receiving data on options.

Limit on inquiries per minute: Unlimited

HTTPS GET

Request:

{
    "cmd"    (string) : "getOptionsByMktNameAndBaseAsset",
    "params" (array)  : {
        "ltr"                (string) : "FIX",
        "base_contract_code" (string) : "T.US"
    }
}

Description of request parameters:
Base parameter Parameter Type Description
cmd   string Request execution command
params   array Request execution parameters
params ltr string Market name
params base_contract_code string Underlying contract code

Response:

Getting a response if successful.

[
    {
        "ticker": "+T^D1K40.US",
        "base_contract_code": "T.US",
        "last_trade_date": "2023-01-20",
        "expire_date": "2023-01-20",
        "strike_price": "10",
        "option_type": "CALL"
    },
    {
        "ticker": "+T^C5K14.5.US",
        "base_contract_code": "T.US",
        "last_trade_date": "2022-05-20",
        "expire_date": "2022-05-20",
        "strike_price": "4.5",
        "option_type": "CALL"
    },
    ...
]

We get an answer in case of failure

// Common error
{
    "errMsg" : "Bad json",
    "code"   : 2
}


Description of response parameters:
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

Examples of using

This example was made using open source library jQuery
  • JS (jQuery)

    /**
     * @type {getOptionsByMktNameAndBaseAsset}
     */
    var exampleParams = {
        "cmd": "getOptionsByMktNameAndBaseAsset",
        "params": {
            "ltr": "FIX",
            "base_contract_code": "T.US"
        }
    };
    
    function getOptionsByMktNameAndBaseAsset(callback) {
        $.getJSON("https://tradernet.com/api/", {q: JSON.stringify(exampleParams)}, callback);
    }
    
    /**
     * Get the object
     **/
    getOptionsByMktNameAndBaseAsset(function(json){
        console.log(json);
    });