# 評価サマリーの取得
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_research_rating_summary(code, rating_dimension_type=None, uid=None, num=None, next_key=None)
説明
指定銘柄の機関または分析師の評価サマリーリスト、または指定機関/分析師の評価詳細をページング対応で取得します
パラメータ
パラメータ 型 説明 code str 銘柄コード rating_dimension_type ResearchRatingDimensionType 評価ディメンション 0=Unknown、1=Institution(機関)、2=Analyst(分析師);デフォルトは機関uid str 機関または分析師の UID 空=当銘柄の評価サマリーリストを取得
非空=指定 uid の評価詳細を取得(分析師 uid の場合は rating_dimension_type=2 と併用)num int 1ページあたりの返却数 デフォルト 10、範囲 1~20next_key str ページングキー 初回は空;続きを取得する際は前回返却の next_key を指定;"-1" はデータなし戻り値
パラメータ 型 説明 ret RET_CODE API 呼び出し結果 data dict ret == RET_OK の場合、評価サマリーデータの辞書を返す str ret != RET_OK の場合、エラーの説明を返す 返される辞書には以下のフィールドが含まれます:
フィールド 型 説明 inst_rating_summary_list list 機関評価サマリーリスト uid が空かつ rating_dimension_type=1 の場合に設定
各項目に institution_info と rating_item_list を含むanalyst_rating_summary_list list 分析師評価サマリーリスト uid が空かつ rating_dimension_type=2 の場合に設定
各項目に analyst_info と rating_item_list を含むinst_rating_detail dict 機関評価詳細 uid が非空かつ rating_dimension_type=1 の場合に設定
institution_info、analyst_info_list、rating_item_list を含むanalyst_rating_detail dict 分析師評価詳細 uid が非空かつ rating_dimension_type=2 の場合に設定
analyst_info と rating_item_list を含むnext_key str ページングキー "-1" はデータなしinst_rating_summary_list の各項目フィールド(機関評価サマリー行):
フィールド 型 説明 institution_info dict 機関情報、下表参照 rating_item_list list 評価記録リスト、下表参照 institution_info フィールド(InstInfo):
フィールド 型 説明 institution_uid str 機関の一意識別子 institution_picture_url str 機関画像 URL institution_name str 機関名 update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーンinstitution_source_name str 機関ソース名 institution_en_name str 機関英語名 analyst_info フィールド(AnalystInfo):
フィールド 型 説明 analyst_uid str 分析師の一意識別子 analyst_name str 分析師名 analyst_picture_url str 分析師アバター URL num_of_stars float スター評価 0.0~5.0、例: 3.50 は 3.5 スターsuccess_rate float 成功率 パーセント記号前の値、例: 12.34 は 12.34%excess_return float 超過収益 パーセント記号前の値、例: 12.34 は 12.34%stock_success_rate float 個別銘柄成功率 パーセント記号前の値、例: 12.34 は 12.34%stock_avg_return float 個別銘柄平均収益 パーセント記号前の値、例: 12.34 は 12.34%institution_info dict 所属機関情報、institution_info フィールド表参照 update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーンrating_item_list の各項目フィールド(RatingItem):
フィールド 型 説明 analyst_uid str 分析師の一意識別子 institution_uid str 機関の一意識別子 rating ResearchRatingType 評価 0=Unknown、1=Sell、2=Underperform、3=Hold、4=Buy、5=StrongBuy
本 API は Sell(1)/Hold(3)/Buy(4) のみ返却、値が大きいほど評価が高いtarget_price float 目標株価 recommendation_date int 評価日タイムスタンプ(秒、市場タイムゾーン) recommendation_date_str str 評価日付 形式 YYYY-MM-DD、市場タイムゾーンrating_url str 評価ソース URL update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーン
Example
from futu import *
import pandas as pd
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_research_rating_summary("US.AAPL", rating_dimension_type=1)
if ret == RET_OK:
rows = []
for row in data.get('inst_rating_summary_list', []):
info = row.get('institution_info', {})
rows.append({
'institution_name': info.get('institution_name', ''),
'institution_en_name': info.get('institution_en_name', ''),
'institution_uid': info.get('institution_uid', ''),
'institution_source_name': info.get('institution_source_name', ''),
'update_time_str': info.get('update_time_str', ''),
})
df = pd.DataFrame(rows)
print(df.to_string(index=False))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- Output
institution_name institution_en_name institution_uid institution_source_name update_time_str
Wedbush Wedbush 8c9ae25a-07e2-4d52-a511-b0dd115a5224 Wedbush 2024-03-01
Evercore Evercore a746f081-c12a-4d6d-8067-f4b6634de478 Evercore ISI 2024-03-21
UBS UBS 1d3bfc25-1dda-48fd-bd9f-d4de47e68def UBS 2024-03-01
Goldman Sachs Goldman Sachs d0e296b4-c2e4-4fad-837c-cd79aaed2e8e Goldman Sachs 2024-03-01
Bernstein Bernstein 16358c98-ccc1-4d08-a875-2c727b7b8d70 Bernstein 2024-03-01
DBS DBS 44dec2a6-aca9-4b52-9fed-4bbf78749783 DBS 2024-03-01
BofA Securities BofA Securities 7890753d-5482-4311-a7af-8d5feed39f3e Bank of America Securities 2024-03-01
Phillip Securities Phillip Securities a294f0ca-10c0-4884-86a7-359995505e70 Phillip Securities 2024-09-09
J.P. Morgan J.P. Morgan f5ec822c-d561-4db3-a09d-a1e71a9a832f J.P. Morgan 2024-03-01
Morgan Stanley Morgan Stanley 9a29ac93-221c-4c1a-ba1a-bbbbf57a5ca6 Morgan Stanley 2024-03-01
2
3
4
5
6
7
8
9
10
11
# Qot_GetResearchRatingSummary.proto
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=当銘柄の評価サマリーリスト;非空=指定 uid(institutionUid または analystUid)の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;続きは前回返却の nextKey を指定;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0、例: 3.50 は 3.5 スター)
optional double successRate = 5; // 成功率、パーセント記号前の値、例: 12.34 は 12.34%
optional double excessReturn = 6; // 超過収益、パーセント記号前の値、例: 12.34 は 12.34%
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値、例: 12.34 は 12.34%
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値、例: 12.34 は 12.34%
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価(Qot_Common.ResearchRatingType 参照)、Sell(1)/Hold(3)/Buy(4) のみ返却、値が大きいほど評価が高い
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD、市場タイムゾーン
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
}
// 機関評価サマリー行(uid 空, ratingDimensionType=1)
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の当銘柄に対する評価記録リスト
}
// 分析師評価サマリー行(uid 空, ratingDimensionType=2)
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の当銘柄に対する評価記録リスト
}
// 機関評価詳細(uid 非空, ratingDimensionType=1)
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト(簡略版、stockSuccessRate/stockAvgReturn/institutionInfo 除く)
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
// 分析師評価詳細(uid 非空, ratingDimensionType=2)
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報(所属 institutionInfo を含む)
repeated RatingItem ratingItemList = 2; // 当分析師の当銘柄に対する評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト(uid 空, ratingDimensionType=1 の場合に設定)
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト(uid 空, ratingDimensionType=2 の場合に設定)
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細(uid 非空, ratingDimensionType=1 の場合に設定)
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細(uid 非空, ratingDimensionType=2 の場合に設定)
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
プロトコル ID
3230
uint GetResearchRatingSummary(QotGetResearchRatingSummary.Request req);
virtual void OnReply_GetResearchRatingSummary(FTAPI_Conn client, uint nSerialNo, QotGetResearchRatingSummary.Response rsp);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
public class Program : FTSPI_Qot, FTSPI_Conn
{
FTAPI_Qot qot = new FTAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(FTAPI_Conn client, long errCode, String desc)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL")
.Build();
QotGetResearchRatingSummary.C2S c2s = QotGetResearchRatingSummary.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetResearchRatingSummary.Request req = QotGetResearchRatingSummary.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetResearchRatingSummary(req);
Console.Write("Send QotGetResearchRatingSummary: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetResearchRatingSummary(FTAPI_Conn client, uint nSerialNo, QotGetResearchRatingSummary.Response rsp)
{
Console.Write("Reply: QotGetResearchRatingSummary: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
FTAPI.Init();
Program qot = new Program();
qot.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
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
55
56
- Output
sent seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
int getResearchRatingSummary(QotGetResearchRatingSummary.Request req);
void onReply_GetResearchRatingSummary(FTAPI_Conn client, int nSerialNo, QotGetResearchRatingSummary.Response rsp);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
public class QotDemo implements FTSPI_Qot, FTSPI_Conn {
FTAPI_Conn_Qot qot = new FTAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1);
qot.setConnSpi(this);
qot.setQotSpi(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL")
.build();
QotGetResearchRatingSummary.C2S c2s = QotGetResearchRatingSummary.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetResearchRatingSummary.Request req = QotGetResearchRatingSummary.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getResearchRatingSummary(req);
System.out.printf("Send QotGetResearchRatingSummary: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetResearchRatingSummary(FTAPI_Conn client, int nSerialNo, QotGetResearchRatingSummary.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetResearchRatingSummary failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetResearchRatingSummary: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
FTAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
55
56
57
58
59
60
61
62
63
64
65
66
- Output
Qot onInitConnect: ret=0 desc= connID=7459212582745187470
Send Qot_GetResearchRatingSummary: 2
Receive Qot_GetResearchRatingSummary: retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400.0
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
Futu::u32_t GetResearchRatingSummary(const Qot_GetResearchRatingSummary::Request &stReq);
virtual void OnReply_GetResearchRatingSummary(Futu::u32_t nSerialNo, const Qot_GetResearchRatingSummary::Response &stRsp) = 0;
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
class Program : public FTSPI_Qot, public FTSPI_Trd, 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) {
cout << "connect" << endl;
// construct request message
Qot_GetResearchRatingSummary::Request req;
Qot_GetResearchRatingSummary::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("AAPL");
sec->set_market(Qot_Common::QotMarket::QotMarket_US_Security);
m_pQotApi->GetResearchRatingSummary(req);
cout << "GetResearchRatingSummary" << endl;
}
virtual void OnReply_GetResearchRatingSummary(Futu::u32_t nSerialNo, const Qot_GetResearchRatingSummary::Response &stRsp){
cout << "OnReply_GetResearchRatingSummary:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
};
int32_t main(int32_t argc, char** argv)
{
FTAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
FTAPI::UnInit();
return 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- Output
onInitConnect: ret=0 desc=Succeed!
Send Qot_GetResearchRatingSummary seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
GetResearchRatingSummary(req);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetResearchRatingSummary(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_US_Security,
code: "AAPL",
},
},
};
websocket.GetResearchRatingSummary(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetResearchRatingSummary: 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("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000);
}
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
- Output
GetResearchRatingSummary: errCode 0, retMsg , retType 0
{
"instRatingSummaryList": [{
"institutionInfo": {
"institutionUid": "8c9ae25a-07e2-4d52-a511-b0dd115a5224",
"institutionPictureUrl": "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg",
"institutionName": "Wedbush",
"updateTime": "1709278279",
"updateTimeStr": "2024-03-01",
"institutionSourceName": "Wedbush",
"institutionEnName": "Wedbush"
},
"ratingItemList": [{
"institutionUid": "8c9ae25a-07e2-4d52-a511-b0dd115a5224",
"rating": "ResearchRatingType_Buy",
"targetPrice": 400,
"recommendationDate": "1778216400",
"recommendationDateStr": "2026-05-08",
"ratingUrl": "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news",
"updateTime": "1778322675652242",
"updateTimeStr": "2026-05-09"
//...
}]
//...
}],
"nextKey": "10"
}
stop
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
API 制限
- 30秒以内に最大30回リクエスト可能です。
- 米国株の普通株および REIT に対応しています。
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_research_rating_summary(code, rating_dimension_type=None, uid=None, num=None, next_key=None)
説明
指定銘柄の機関または分析師の評価サマリーリスト、または指定機関/分析師の評価詳細をページング対応で取得します
パラメータ
パラメータ 型 説明 code str 銘柄コード rating_dimension_type ResearchRatingDimensionType 評価ディメンション 0=Unknown、1=Institution(機関)、2=Analyst(分析師);デフォルトは機関uid str 機関または分析師の UID 空=当銘柄の評価サマリーリストを取得
非空=指定 uid の評価詳細を取得(分析師 uid の場合は rating_dimension_type=2 と併用)num int 1ページあたりの返却数 デフォルト 10、範囲 1~20next_key str ページングキー 初回は空;続きを取得する際は前回返却の next_key を指定;"-1" はデータなし戻り値
パラメータ 型 説明 ret RET_CODE API 呼び出し結果 data dict ret == RET_OK の場合、評価サマリーデータの辞書を返す str ret != RET_OK の場合、エラーの説明を返す 返される辞書には以下のフィールドが含まれます:
フィールド 型 説明 inst_rating_summary_list list 機関評価サマリーリスト uid が空かつ rating_dimension_type=1 の場合に設定
各項目に institution_info と rating_item_list を含むanalyst_rating_summary_list list 分析師評価サマリーリスト uid が空かつ rating_dimension_type=2 の場合に設定
各項目に analyst_info と rating_item_list を含むinst_rating_detail dict 機関評価詳細 uid が非空かつ rating_dimension_type=1 の場合に設定
institution_info、analyst_info_list、rating_item_list を含むanalyst_rating_detail dict 分析師評価詳細 uid が非空かつ rating_dimension_type=2 の場合に設定
analyst_info と rating_item_list を含むnext_key str ページングキー "-1" はデータなしinst_rating_summary_list の各項目フィールド(機関評価サマリー行):
フィールド 型 説明 institution_info dict 機関情報、下表参照 rating_item_list list 評価記録リスト、下表参照 institution_info フィールド(InstInfo):
フィールド 型 説明 institution_uid str 機関の一意識別子 institution_picture_url str 機関画像 URL institution_name str 機関名 update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーンinstitution_source_name str 機関ソース名 institution_en_name str 機関英語名 analyst_info フィールド(AnalystInfo):
フィールド 型 説明 analyst_uid str 分析師の一意識別子 analyst_name str 分析師名 analyst_picture_url str 分析師アバター URL num_of_stars float スター評価 0.0~5.0、例: 3.50 は 3.5 スターsuccess_rate float 成功率 パーセント記号前の値、例: 12.34 は 12.34%excess_return float 超過収益 パーセント記号前の値、例: 12.34 は 12.34%stock_success_rate float 個別銘柄成功率 パーセント記号前の値、例: 12.34 は 12.34%stock_avg_return float 個別銘柄平均収益 パーセント記号前の値、例: 12.34 は 12.34%institution_info dict 所属機関情報、institution_info フィールド表参照 update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーンrating_item_list の各項目フィールド(RatingItem):
フィールド 型 説明 analyst_uid str 分析師の一意識別子 institution_uid str 機関の一意識別子 rating ResearchRatingType 評価 0=Unknown、1=Sell、2=Underperform、3=Hold、4=Buy、5=StrongBuy
本 API は Sell(1)/Hold(3)/Buy(4) のみ返却、値が大きいほど評価が高いtarget_price float 目標株価 recommendation_date int 評価日タイムスタンプ(秒、市場タイムゾーン) recommendation_date_str str 評価日付 形式 YYYY-MM-DD、市場タイムゾーンrating_url str 評価ソース URL update_time int 更新タイムスタンプ(秒、市場タイムゾーン) update_time_str str 更新日付 形式 YYYY-MM-DD、市場タイムゾーン
Example
from moomoo import *
import pandas as pd
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_research_rating_summary("US.AAPL", rating_dimension_type=1)
if ret == RET_OK:
rows = []
for row in data.get('inst_rating_summary_list', []):
info = row.get('institution_info', {})
rows.append({
'institution_name': info.get('institution_name', ''),
'institution_en_name': info.get('institution_en_name', ''),
'institution_uid': info.get('institution_uid', ''),
'institution_source_name': info.get('institution_source_name', ''),
'update_time_str': info.get('update_time_str', ''),
})
df = pd.DataFrame(rows)
print(df.to_string(index=False))
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- Output
institution_name institution_en_name institution_uid institution_source_name update_time_str
Wedbush Wedbush 8c9ae25a-07e2-4d52-a511-b0dd115a5224 Wedbush 2024-03-01
Evercore Evercore a746f081-c12a-4d6d-8067-f4b6634de478 Evercore ISI 2024-03-21
UBS UBS 1d3bfc25-1dda-48fd-bd9f-d4de47e68def UBS 2024-03-01
Goldman Sachs Goldman Sachs d0e296b4-c2e4-4fad-837c-cd79aaed2e8e Goldman Sachs 2024-03-01
Bernstein Bernstein 16358c98-ccc1-4d08-a875-2c727b7b8d70 Bernstein 2024-03-01
DBS DBS 44dec2a6-aca9-4b52-9fed-4bbf78749783 DBS 2024-03-01
BofA Securities BofA Securities 7890753d-5482-4311-a7af-8d5feed39f3e Bank of America Securities 2024-03-01
Phillip Securities Phillip Securities a294f0ca-10c0-4884-86a7-359995505e70 Phillip Securities 2024-09-09
J.P. Morgan J.P. Morgan f5ec822c-d561-4db3-a09d-a1e71a9a832f J.P. Morgan 2024-03-01
Morgan Stanley Morgan Stanley 9a29ac93-221c-4c1a-ba1a-bbbbf57a5ca6 Morgan Stanley 2024-03-01
2
3
4
5
6
7
8
9
10
11
# Qot_GetResearchRatingSummary.proto
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=当銘柄の評価サマリーリスト;非空=指定 uid(institutionUid または analystUid)の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;続きは前回返却の nextKey を指定;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0、例: 3.50 は 3.5 スター)
optional double successRate = 5; // 成功率、パーセント記号前の値、例: 12.34 は 12.34%
optional double excessReturn = 6; // 超過収益、パーセント記号前の値、例: 12.34 は 12.34%
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値、例: 12.34 は 12.34%
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値、例: 12.34 は 12.34%
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価(Qot_Common.ResearchRatingType 参照)、Sell(1)/Hold(3)/Buy(4) のみ返却、値が大きいほど評価が高い
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD、市場タイムゾーン
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD、市場タイムゾーン
}
// 機関評価サマリー行(uid 空, ratingDimensionType=1)
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の当銘柄に対する評価記録リスト
}
// 分析師評価サマリー行(uid 空, ratingDimensionType=2)
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の当銘柄に対する評価記録リスト
}
// 機関評価詳細(uid 非空, ratingDimensionType=1)
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト(簡略版、stockSuccessRate/stockAvgReturn/institutionInfo 除く)
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
// 分析師評価詳細(uid 非空, ratingDimensionType=2)
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報(所属 institutionInfo を含む)
repeated RatingItem ratingItemList = 2; // 当分析師の当銘柄に対する評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト(uid 空, ratingDimensionType=1 の場合に設定)
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト(uid 空, ratingDimensionType=2 の場合に設定)
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細(uid 非空, ratingDimensionType=1 の場合に設定)
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細(uid 非空, ratingDimensionType=2 の場合に設定)
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
プロトコル ID
3230
uint GetResearchRatingSummary(QotGetResearchRatingSummary.Request req);
virtual void OnReply_GetResearchRatingSummary(MMAPI_Conn client, uint nSerialNo, QotGetResearchRatingSummary.Response rsp);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
public class Program : MMSPI_Qot, MMSPI_Conn
{
MMAPI_Qot qot = new MMAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(MMAPI_Conn client, long errCode, String desc)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL")
.Build();
QotGetResearchRatingSummary.C2S c2s = QotGetResearchRatingSummary.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetResearchRatingSummary.Request req = QotGetResearchRatingSummary.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetResearchRatingSummary(req);
Console.Write("Send QotGetResearchRatingSummary: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetResearchRatingSummary(MMAPI_Conn client, uint nSerialNo, QotGetResearchRatingSummary.Response rsp)
{
Console.Write("Reply: QotGetResearchRatingSummary: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
MMAPI.Init();
Program qot = new Program();
qot.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
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
55
56
- Output
sent seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
int getResearchRatingSummary(QotGetResearchRatingSummary.Request req);
void onReply_GetResearchRatingSummary(MMAPI_Conn client, int nSerialNo, QotGetResearchRatingSummary.Response rsp);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
public class QotDemo implements MMSPI_Qot, MMSPI_Conn {
MMAPI_Conn_Qot qot = new MMAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1);
qot.setConnSpi(this);
qot.setQotSpi(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL")
.build();
QotGetResearchRatingSummary.C2S c2s = QotGetResearchRatingSummary.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetResearchRatingSummary.Request req = QotGetResearchRatingSummary.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getResearchRatingSummary(req);
System.out.printf("Send QotGetResearchRatingSummary: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetResearchRatingSummary(MMAPI_Conn client, int nSerialNo, QotGetResearchRatingSummary.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetResearchRatingSummary failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetResearchRatingSummary: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
MMAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
55
56
57
58
59
60
61
62
63
64
65
66
- Output
Qot onInitConnect: ret=0 desc= connID=7459212582745187470
Send Qot_GetResearchRatingSummary: 2
Receive Qot_GetResearchRatingSummary: retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400.0
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
moomoo::u32_t GetResearchRatingSummary(const Qot_GetResearchRatingSummary::Request &stReq);
virtual void OnReply_GetResearchRatingSummary(moomoo::u32_t nSerialNo, const Qot_GetResearchRatingSummary::Response &stRsp) = 0;
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
class Program : public MMSPI_Qot, public MMSPI_Trd, 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) {
cout << "connect" << endl;
// construct request message
Qot_GetResearchRatingSummary::Request req;
Qot_GetResearchRatingSummary::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("AAPL");
sec->set_market(Qot_Common::QotMarket::QotMarket_US_Security);
m_pQotApi->GetResearchRatingSummary(req);
cout << "GetResearchRatingSummary" << endl;
}
virtual void OnReply_GetResearchRatingSummary(moomoo::u32_t nSerialNo, const Qot_GetResearchRatingSummary::Response &stRsp){
cout << "OnReply_GetResearchRatingSummary:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
};
int32_t main(int32_t argc, char** argv)
{
MMAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
MMAPI::UnInit();
return 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- Output
onInitConnect: ret=0 desc=Succeed!
Send Qot_GetResearchRatingSummary seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
instRatingSummaryList {
institutionInfo {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
institutionPictureUrl: "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg"
institutionName: "Wedbush"
updateTime: 1709278279
updateTimeStr: "2024-03-01"
institutionSourceName: "Wedbush"
institutionEnName: "Wedbush"
}
ratingItemList {
institutionUid: "8c9ae25a-07e2-4d52-a511-b0dd115a5224"
rating: ResearchRatingType_Buy
targetPrice: 400
recommendationDate: 1778216400
recommendationDateStr: "2026-05-08"
ratingUrl: "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news"
updateTime: 1778322675652242
updateTimeStr: "2026-05-09"
}
ratingItemList {
//...
}
}
instRatingSummaryList {
//...
}
nextKey: "10"
}
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
GetResearchRatingSummary(req);
説明
評価サマリーの取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional Qot_Common.ResearchRatingDimensionType ratingDimensionType = 2; // 評価ディメンション(Qot_Common.ResearchRatingDimensionType 参照)、デフォルトは機関
optional string uid = 3; // 空=サマリーリスト;非空=指定 uid の評価詳細
optional string nextKey = 4; // ページングキー;初回は空;"-1" はデータなし
optional int32 num = 5; // 1ページあたりの返却数、デフォルト 10、範囲 1~20
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
- Security 構造は Security 参照
- 評価ディメンション型は ResearchRatingDimensionType 参照
- 戻り値
message InstInfo
{
optional string institutionUid = 1; // 機関の一意識別子
optional string institutionPictureUrl = 2; // 機関画像 URL
optional string institutionName = 3; // 機関名
optional int64 updateTime = 4; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 5; // 更新時刻文字列、形式 YYYY-MM-DD
optional string institutionSourceName = 6; // 機関ソース名
optional string institutionEnName = 7; // 機関英語名
}
message AnalystInfo
{
optional string analystUid = 1; // 分析師の一意識別子
optional string analystName = 2; // 分析師名
optional string analystPictureUrl = 3; // 分析師アバター URL
optional double numOfStars = 4; // スター評価(0.0~5.0)
optional double successRate = 5; // 成功率、パーセント記号前の値
optional double excessReturn = 6; // 超過収益、パーセント記号前の値
optional double stockSuccessRate = 7; // 個別銘柄成功率、パーセント記号前の値
optional double stockAvgReturn = 8; // 個別銘柄平均収益、パーセント記号前の値
optional InstInfo institutionInfo = 9; // 所属機関情報
optional int64 updateTime = 10; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 11; // 更新時刻文字列、形式 YYYY-MM-DD
}
message RatingItem
{
optional string analystUid = 1; // 分析師の一意識別子
optional string institutionUid = 2; // 機関の一意識別子
optional Qot_Common.ResearchRatingType rating = 3; // 評価、Sell(1)/Hold(3)/Buy(4) のみ返却
optional double targetPrice = 4; // 目標株価
optional int64 recommendationDate = 5; // 評価日タイムスタンプ(秒)
optional string recommendationDateStr = 6; // 評価日付文字列、形式 YYYY-MM-DD
optional string ratingUrl = 7; // 評価ソース URL
optional int64 updateTime = 8; // 更新タイムスタンプ(秒)
optional string updateTimeStr = 9; // 更新時刻文字列、形式 YYYY-MM-DD
}
message InstRatingSummaryItem
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated RatingItem ratingItemList = 2; // 当機関の評価記録リスト
}
message AnalystRatingSummaryItem
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message InstRatingDetail
{
optional InstInfo institutionInfo = 1; // 機関情報
repeated AnalystInfo analystInfoList = 2; // 機関傘下の分析師リスト
repeated RatingItem ratingItemList = 3; // 機関傘下の評価記録リスト
}
message AnalystRatingDetail
{
optional AnalystInfo analystInfo = 1; // 分析師情報
repeated RatingItem ratingItemList = 2; // 当分析師の評価記録リスト
}
message S2C
{
repeated InstRatingSummaryItem instRatingSummaryList = 1; // 機関評価サマリーリスト
repeated AnalystRatingSummaryItem analystRatingSummaryList = 2; // 分析師評価サマリーリスト
optional InstRatingDetail instRatingDetail = 3; // 機関評価詳細
optional AnalystRatingDetail analystRatingDetail = 4; // 分析師評価詳細
optional string nextKey = 5; // ページングキー、"-1" はデータなし
}
message Response
{
required int32 retType = 1 [default = -400]; // 返却結果、Common.RetType 参照
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
- API 呼び出し結果の構造は RetType 参照
- 分析師評価型は ResearchRatingType 参照
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetResearchRatingSummary(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_US_Security,
code: "AAPL",
},
},
};
websocket.GetResearchRatingSummary(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetResearchRatingSummary: 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("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000);
}
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
- Output
GetResearchRatingSummary: errCode 0, retMsg , retType 0
{
"instRatingSummaryList": [{
"institutionInfo": {
"institutionUid": "8c9ae25a-07e2-4d52-a511-b0dd115a5224",
"institutionPictureUrl": "https://foss1.futunn.com/tip_rank_analysts_data_sync/prod/institution/8c9ae25a-07e2-4d52-a511-b0dd115a5224.jpeg",
"institutionName": "Wedbush",
"updateTime": "1709278279",
"updateTimeStr": "2024-03-01",
"institutionSourceName": "Wedbush",
"institutionEnName": "Wedbush"
},
"ratingItemList": [{
"institutionUid": "8c9ae25a-07e2-4d52-a511-b0dd115a5224",
"rating": "ResearchRatingType_Buy",
"targetPrice": 400,
"recommendationDate": "1778216400",
"recommendationDateStr": "2026-05-08",
"ratingUrl": "https://www.tipranks.com/news/the-fly/apple-price-target-raised-to-400-from-350-at-wedbush-thefly-news",
"updateTime": "1778322675652242",
"updateTimeStr": "2026-05-09"
//...
}]
//...
}],
"nextKey": "10"
}
stop
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
API 制限
- 30秒以内に最大30回リクエスト可能です。
- 米国株の普通株および REIT に対応しています。