# Option Contract Rank
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_rank(option_market, sort_type, count=None, trading_date=None, sort_direction=None, page=None, filter_list=None)
Description
Get option contract ranking list, supports sorting by volume, open interest, OI increment, OI decrement, IV, change rate, and other dimensions.
Parameters
Parameter Type Description option_market OptionMarket Option market type US_SECURITY=US equity options, US_INDEX=US index options, HK_SECURITY=HK equity options, HK_INDEX=HK index optionssort_type OptionRankType Sort type VOLUME=Volume, TURNOVER=Turnover, OI=Open interest, OI_INCREMENT=OI increment(daily), OI_DECREMENT=OI decrement(daily), OI_MARKET_CAP=OI market cap, OI_MARKET_CAP_INCREMENT=OI market cap increment(daily), OI_MARKET_CAP_DECREMENT=OI market cap decrement(daily), CHANGE_RATE=Price change rate, IV=Implied volatilitycount int Return count Range [1,200], default 200trading_date str Trading date Format yyyy-MM-dd, returns latest ranking if not specifiedsort_direction int Sort direction 0=descending(default), 1=ascendingpage str Pagination cursor Omit for the first request, pass next_page for subsequent pagesfilter_list list[OptionRankFilter] Filter conditions list Multiple conditions are combined with AND logicReturns
Returns a 4-tuple (ret, data, next_page, all_count)
Parameter Type Description ret RET_CODE Interface call result data pandas.DataFrame When ret == RET_OK, returns ranking data data str When ret != RET_OK, returns error description next_page str Pagination cursor for next page, None means no more data all_count int Total count matching filter conditions data DataFrame fields:
Field Type Description code str Option contract code name str Option name option_type str Option type CALL/PUToi_increment int OI increment (>=0) oi_decrement int OI decrement (>=0) oi_market_cap_increment float OI market cap increment (>=0) oi_market_cap_decrement float OI market cap decrement (>=0) volume int Volume turnover float Turnover open_interest int Open interest open_interest_market_cap float Open interest market cap iv float Implied volatility (percentage) option_price float Option latest price change_ratio float Price change ratio (decimal) mid_price float Mid price bid_price float Bid price bid_volume int Bid volume ask_price float Ask price ask_volume int Ask volume delta float Delta gamma float Gamma theta float Theta vega float Vega rho float Rho trading_date str Trading date of ranking data trading_timestamp float Trading date timestamp (Unix seconds)
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, all_count = quote_ctx.get_option_rank(
OptionMarket.US_SECURITY,
OptionRankType.VOLUME,
count=5
)
if ret == RET_OK:
print(data)
print('all_count:', all_count)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- Output
code name option_type oi_increment oi_decrement oi_market_cap_increment oi_market_cap_decrement volume turnover open_interest open_interest_market_cap iv option_price change_ratio mid_price bid_price bid_volume ask_price ask_volume delta gamma theta vega rho trading_date trading_timestamp
0 US.SPY260612C742000 SPY 260612 742.00C CALL 1816 N/A 105328.0 N/A 730160 91928623.0 7449 432042.0 146.507 0.58 -67.688 0.580 0.56 28 0.60 1 0.43674 0.27447 -455.46028 0.00385 0.0 2026-06-12 1.781237e+09
1 US.SPY260612C745000 SPY 260612 745.00C CALL 5416 N/A 5416.0 N/A 617981 44479304.0 17013 17013.0 87.067 0.01 -98.958 0.015 0.01 708 0.02 500 0.02438 0.03501 -18.52310 0.00107 0.0 2026-06-12 1.781237e+09
2 US.SPY260612C743000 SPY 260612 743.00C CALL 5438 N/A 48942.0 N/A 606769 64419534.0 7426 66834.0 59.082 0.09 -93.898 0.095 0.09 208 0.10 118 0.13412 0.19487 -50.92453 0.00405 0.0 2026-06-12 1.781237e+09
3 US.SPY260612P740000 SPY 260612 740.00P PUT 1223 N/A 1223.0 N/A 566915 69291991.0 15291 15291.0 53.083 0.01 -99.790 0.015 0.01 447 0.02 407 -0.03761 0.08224 -16.47701 0.00153 0.0 2026-06-12 1.781237e+09
4 US.SPY260612C741000 SPY 260612 741.00C CALL 2924 N/A 423980.0 N/A 506505 88981079.0 6229 903205.0 224.448 1.45 -33.179 1.520 1.46 12 1.58 23 0.63754 0.17055 -662.49947 0.00367 0.0 2026-06-12 1.781237e+09
all_count: 1955829
2
3
4
5
6
7
# Qot_GetOptionRank.proto
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
uint GetOptionRank(Qot_GetOptionRank.Request req); virtual void OnReply_GetOptionRank(FTAPI_Conn client, uint nSerialNo, Qot_GetOptionRank.Response rsp);
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
int getOptionRank(Qot_GetOptionRank.Request req) onReply_GetOptionRank(FTAPI_Conn client, int nSerialNo, Qot_GetOptionRank.Response rsp)
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
Futu::u32_t GetOptionRank(const Qot_GetOptionRank::Request &stReq);
virtual void OnReply_GetOptionRank(Futu::u32_t nSerialNo, const Qot_GetOptionRank::Response &stRsp) = 0;
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
Protocol ID
TODO
Example
class Program : public FTSPI_Qot, public FTSPI_Conn
{
public:
Program() {
m_pQotApi = FTAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr) {
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
FTAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(FTAPI_Conn* pConn, Futu::i64_t nErrCode, const char* strDesc) {
Qot_GetOptionRank::Request req;
Qot_GetOptionRank::C2S *c2s = req.mutable_c2s();
// TODO: populate c2s fields per proto
m_GetOptionRankSerialNo = m_pQotApi->GetOptionRank(req);
}
virtual void OnReply_GetOptionRank(Futu::u32_t nSerialNo, const Qot_GetOptionRank::Response &stRsp) {
if (nSerialNo != m_GetOptionRankSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetOptionRankSerialNo = 0;
};
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
getOptionRank(qotGetOptionRank)
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
Example
import ftWebsocket from "futu-api";
import { Common, Qot_OptionCommon } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetOptionRank(){
const { RetType } = Common
const { OptionMarket, OptionRankType } = Qot_OptionCommon
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11112, false, ''];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
optionMarket: OptionMarket.OptionMarket_US_Security,
sortType: OptionRankType.OptionRankType_Volume,
count: 5,
},
};
websocket.GetOptionRank(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionRank: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true });
console.log(data);
}
})
.catch((error)=>{ console.log("error:", error); });
} else {
console.log("start error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{ websocket.stop(); process.exit(); }, 5000);
}
QotGetOptionRank()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- Output
GetOptionRank: errCode 0, retMsg , retType 0
{
"optionMarket": 1,
"sortType": 1,
"tradingDate": "2026-06-12",
"tradingTimestamp": 1781237000,
"rankList": [
{
"option": { "market": 1, "code": "SPY260612C742000" },
"name": "SPY 260612 742.00C",
"optionType": 1,
"oiIncrement": 1816,
"volume": 730160,
"turnover": 91928623,
"openInterest": 7449,
"iv": 146.507,
"optionPrice": 0.58,
"changeRate": -67.688,
"midPrice": 0.58,
"bidPrice": 0.56,
"bidVolume": 28,
"askPrice": 0.6,
"askVolume": 1,
"delta": 0.43674,
"gamma": 0.27447,
"theta": -455.46028,
"vega": 0.00385,
"rho": 0
},
{
"option": { "market": 1, "code": "SPY260612C745000" },
"name": "SPY 260612 745.00C",
"optionType": 1,
"oiIncrement": 5416,
"volume": 617981,
"turnover": 44479304,
"openInterest": 17013,
"iv": 87.067,
"optionPrice": 0.01,
"changeRate": -98.958,
"midPrice": 0.015,
"bidPrice": 0.01,
"bidVolume": 708,
"askPrice": 0.02,
"askVolume": 500,
"delta": 0.02438,
"gamma": 0.03501,
"theta": -18.5231,
"vega": 0.00107,
"rho": 0
}
],
"allCount": 1955829
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Rate Limit
- Maximum 60 requests per 30 seconds for the option contract rank interface (for paginated interfaces, only the first call counts)
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_rank(option_market, sort_type, count=None, trading_date=None, sort_direction=None, page=None, filter_list=None)
Description
Get option contract ranking list, supports sorting by volume, open interest, OI increment, OI decrement, IV, change rate, and other dimensions.
Parameters
Parameter Type Description option_market OptionMarket Option market type US_SECURITY=US equity options, US_INDEX=US index options, HK_SECURITY=HK equity options, HK_INDEX=HK index optionssort_type OptionRankType Sort type VOLUME=Volume, TURNOVER=Turnover, OI=Open interest, OI_INCREMENT=OI increment(daily), OI_DECREMENT=OI decrement(daily), OI_MARKET_CAP=OI market cap, OI_MARKET_CAP_INCREMENT=OI market cap increment(daily), OI_MARKET_CAP_DECREMENT=OI market cap decrement(daily), CHANGE_RATE=Price change rate, IV=Implied volatilitycount int Return count Range [1,200], default 200trading_date str Trading date Format yyyy-MM-dd, returns latest ranking if not specifiedsort_direction int Sort direction 0=descending(default), 1=ascendingpage str Pagination cursor Omit for the first request, pass next_page for subsequent pagesfilter_list list[OptionRankFilter] Filter conditions list Multiple conditions are combined with AND logicReturns
Returns a 4-tuple (ret, data, next_page, all_count)
Parameter Type Description ret RET_CODE Interface call result data pandas.DataFrame When ret == RET_OK, returns ranking data data str When ret != RET_OK, returns error description next_page str Pagination cursor for next page, None means no more data all_count int Total count matching filter conditions data DataFrame fields:
Field Type Description code str Option contract code name str Option name option_type str Option type CALL/PUToi_increment int OI increment (>=0) oi_decrement int OI decrement (>=0) oi_market_cap_increment float OI market cap increment (>=0) oi_market_cap_decrement float OI market cap decrement (>=0) volume int Volume turnover float Turnover open_interest int Open interest open_interest_market_cap float Open interest market cap iv float Implied volatility (percentage) option_price float Option latest price change_ratio float Price change ratio (decimal) mid_price float Mid price bid_price float Bid price bid_volume int Bid volume ask_price float Ask price ask_volume int Ask volume delta float Delta gamma float Gamma theta float Theta vega float Vega rho float Rho trading_date str Trading date of ranking data trading_timestamp float Trading date timestamp (Unix seconds)
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, all_count = quote_ctx.get_option_rank(
OptionMarket.US_SECURITY,
OptionRankType.VOLUME,
count=5
)
if ret == RET_OK:
print(data)
print('all_count:', all_count)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- Output
code name option_type oi_increment oi_decrement oi_market_cap_increment oi_market_cap_decrement volume turnover open_interest open_interest_market_cap iv option_price change_ratio mid_price bid_price bid_volume ask_price ask_volume delta gamma theta vega rho trading_date trading_timestamp
0 US.SPY260612C742000 SPY 260612 742.00C CALL 1816 N/A 105328.0 N/A 730160 91928623.0 7449 432042.0 146.507 0.58 -67.688 0.580 0.56 28 0.60 1 0.43674 0.27447 -455.46028 0.00385 0.0 2026-06-12 1.781237e+09
1 US.SPY260612C745000 SPY 260612 745.00C CALL 5416 N/A 5416.0 N/A 617981 44479304.0 17013 17013.0 87.067 0.01 -98.958 0.015 0.01 708 0.02 500 0.02438 0.03501 -18.52310 0.00107 0.0 2026-06-12 1.781237e+09
2 US.SPY260612C743000 SPY 260612 743.00C CALL 5438 N/A 48942.0 N/A 606769 64419534.0 7426 66834.0 59.082 0.09 -93.898 0.095 0.09 208 0.10 118 0.13412 0.19487 -50.92453 0.00405 0.0 2026-06-12 1.781237e+09
3 US.SPY260612P740000 SPY 260612 740.00P PUT 1223 N/A 1223.0 N/A 566915 69291991.0 15291 15291.0 53.083 0.01 -99.790 0.015 0.01 447 0.02 407 -0.03761 0.08224 -16.47701 0.00153 0.0 2026-06-12 1.781237e+09
4 US.SPY260612C741000 SPY 260612 741.00C CALL 2924 N/A 423980.0 N/A 506505 88981079.0 6229 903205.0 224.448 1.45 -33.179 1.520 1.46 12 1.58 23 0.63754 0.17055 -662.49947 0.00367 0.0 2026-06-12 1.781237e+09
all_count: 1955829
2
3
4
5
6
7
# Qot_GetOptionRank.proto
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
uint GetOptionRank(Qot_GetOptionRank.Request req); virtual void OnReply_GetOptionRank(MMAPI_Conn client, uint nSerialNo, Qot_GetOptionRank.Response rsp);
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
int getOptionRank(Qot_GetOptionRank.Request req) onReply_GetOptionRank(MMAPI_Conn client, int nSerialNo, Qot_GetOptionRank.Response rsp)
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
Moomoo::u32_t GetOptionRank(const Qot_GetOptionRank::Request &stReq);
virtual void OnReply_GetOptionRank(Moomoo::u32_t nSerialNo, const Qot_GetOptionRank::Response &stRsp) = 0;
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
Protocol ID
TODO
Example
class Program : public MMSPI_Qot, public MMSPI_Conn
{
public:
Program() {
m_pQotApi = MMAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr) {
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
MMAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(MMAPI_Conn* pConn, Moomoo::i64_t nErrCode, const char* strDesc) {
Qot_GetOptionRank::Request req;
Qot_GetOptionRank::C2S *c2s = req.mutable_c2s();
// TODO: populate c2s fields per proto
m_GetOptionRankSerialNo = m_pQotApi->GetOptionRank(req);
}
virtual void OnReply_GetOptionRank(Moomoo::u32_t nSerialNo, const Qot_GetOptionRank::Response &stRsp) {
if (nSerialNo != m_GetOptionRankSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
Moomoo::u32_t m_GetOptionRankSerialNo = 0;
};
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
getOptionRank(qotGetOptionRank)
Description
Get option contract ranking list
Parameters
message C2S
{
required int32 optionMarket = 1; //Qot_OptionCommon.OptionMarket
required int32 sortType = 2; //Qot_OptionCommon.OptionRankType
optional int32 count = 3; //Return count [1,200], default 200
optional string tradingDate = 4; //Trading day, format yyyy-MM-dd
optional bool isAsc = 5; //Whether ascending, default false
optional string page = 6; //Page cursor
repeated Qot_OptionCommon.OptionRankIndicator filterList = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- Returns
message OptionRankItem
{
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3;
optional int64 oiIncrement = 4;
optional int64 oiDecrement = 5;
optional double oiMarketCapIncrement = 6;
optional double oiMarketCapDecrement = 7;
optional int64 volume = 8;
optional double turnover = 9;
optional int64 openInterest = 10;
optional double openInterestMarketCap = 11;
optional double iv = 12;
optional double optionPrice = 13;
optional double changeRate = 14;
optional double midPrice = 15;
optional double bidPrice = 16;
optional int64 bidVolume = 17;
optional double askPrice = 18;
optional int64 askVolume = 19;
optional double delta = 20;
optional double gamma = 21;
optional double theta = 22;
optional double vega = 23;
optional double rho = 24;
}
message S2C
{
required int32 optionMarket = 1;
required int32 sortType = 2;
optional string tradingDate = 3;
optional double tradingTimestamp = 4;
repeated OptionRankItem rankList = 5;
optional string nextPage = 6;
optional int32 allCount = 7;
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Interface call result, see RetType
协议 ID
3306
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_OptionCommon } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetOptionRank(){
const { RetType } = Common
const { OptionMarket, OptionRankType } = Qot_OptionCommon
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11112, false, ''];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
optionMarket: OptionMarket.OptionMarket_US_Security,
sortType: OptionRankType.OptionRankType_Volume,
count: 5,
},
};
websocket.GetOptionRank(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionRank: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true });
console.log(data);
}
})
.catch((error)=>{ console.log("error:", error); });
} else {
console.log("start error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{ websocket.stop(); process.exit(); }, 5000);
}
QotGetOptionRank()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- Output
GetOptionRank: errCode 0, retMsg , retType 0
{
"optionMarket": 1,
"sortType": 1,
"tradingDate": "2026-06-12",
"tradingTimestamp": 1781237000,
"rankList": [
{
"option": { "market": 1, "code": "SPY260612C742000" },
"name": "SPY 260612 742.00C",
"optionType": 1,
"oiIncrement": 1816,
"volume": 730160,
"turnover": 91928623,
"openInterest": 7449,
"iv": 146.507,
"optionPrice": 0.58,
"changeRate": -67.688,
"midPrice": 0.58,
"bidPrice": 0.56,
"bidVolume": 28,
"askPrice": 0.6,
"askVolume": 1,
"delta": 0.43674,
"gamma": 0.27447,
"theta": -455.46028,
"vega": 0.00385,
"rho": 0
},
{
"option": { "market": 1, "code": "SPY260612C745000" },
"name": "SPY 260612 745.00C",
"optionType": 1,
"oiIncrement": 5416,
"volume": 617981,
"turnover": 44479304,
"openInterest": 17013,
"iv": 87.067,
"optionPrice": 0.01,
"changeRate": -98.958,
"midPrice": 0.015,
"bidPrice": 0.01,
"bidVolume": 708,
"askPrice": 0.02,
"askVolume": 500,
"delta": 0.02438,
"gamma": 0.03501,
"theta": -18.5231,
"vega": 0.00107,
"rho": 0
}
],
"allCount": 1955829
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Rate Limit
- Maximum 60 requests per 30 seconds for the option contract rank interface (for paginated interfaces, only the first call counts)