# 空売り残高の取得

get_short_interest(stock_code, next_key=None, num=None)

  • 説明

    指定した香港株または米国株の空売り残高の履歴を取得します(ページング対応)

  • パラメータ

    パラメータ 説明
    stock_code str 銘柄コード
    next_key str ページングキー
    num int 1ページあたりの件数
  • 戻り値

    パラメータ 説明
    ret RET_CODE API 呼び出し結果
    us_df pd.DataFrame 米国株の空売り残高データ。ret != RET_OK の場合はエラー文字列
    hk_df pd.DataFrame 香港株の空売り残高データ。ret != RET_OK の場合は None
    • 米国株 DataFrame(us_df)フィールド:

      フィールド 説明
      timestamp int 取引日タイムスタンプ
      timestamp_str str 取引日文字列
      shares_short int 空売り株数
      short_percent float 空売り比率
      avg_daily_share_volume int 平均日次出来高
      days_to_cover float 買い戻し日数
      close_price float 終値
      last_close_price float 前回終値
    • 米国株 us_df.attrs 追加属性:

      属性 説明
      next_key str ページングキー
    • 香港株 DataFrame(hk_df)フィールド:

      フィールド 説明
      timestamp int 取引日タイムスタンプ
      timestamp_str str 取引日文字列
      close_price float 終値
      last_close_price float 前回終値
      aggregated_short int 未決済空売り株数
      aggregated_short_ratio float 流通株に占める比率
    • 香港株 hk_df.attrs 追加属性:

      属性 説明
      next_key str ページングキー
  • Example

from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, us_df, hk_df = quote_ctx.get_short_interest("HK.00700")
if ret == RET_OK:
    print(hk_df)
else:
    print('error:', hk_df)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
  • Output
   timestamp timestamp_str  aggregated_short  aggregated_short_ratio  close_price  last_close_price
0  1777478400    2026-04-30          51480638                    0.56        467.8             479.2
1  1776960000    2026-04-24          51888755                    0.56        493.4             495.2
2  1776355200    2026-04-17          47974208                    0.52        510.5             517.0
3  1775750400    2026-04-10          48424833                    0.53        504.5             508.5
4  1775059200    2026-04-02          49982828                    0.54        489.2             496.6
5  1774540800    2026-03-27          52744147                    0.57        493.4             495.6
6  1773936000    2026-03-20          51710854                    0.56        508.0             513.0
7  1773331200    2026-03-13          48105325                    0.52        547.5             546.5
8  1772726400    2026-03-06          42404275                    0.46        519.0             502.0
9  1772121600    2026-02-27          36037870                    0.39        518.0             512.0
1
2
3
4
5
6
7
8
9
10
11

利用制限

  • 30 秒以内に最大 30 回までリクエスト可能。
  • 香港株・米国株の個別株およびファンドに対応。