# Get US After-Hours Rank

get_us_after_hours_rank(sort_dir=None, count=10, offset=None, filter_list=None)

  • Description

    Get US after-hours rank, returning after-hours trading session change rate rankings, including after-hours price, change rate, turnover, volume, and other data.

  • Parameters

    Parameter Type Description
    sort_dir RankSortDir Sort direction, default descending (top gainers)
    count int Return count [1, 200], default 10
    offset int Start position, default 0
    filter_list list[SimpleRankFilter] Filter condition list (multiple conditions are AND-combined)
  • Input Limits

    • filter_list Filter Conditions(SimpleRankFilter):

      Construct filter conditions via SimpleRankFilter:

      Constructor Parameter Description
      indicator_type Filter indicator type (SimpleRankIndicatorType, required)
      interval_min Range minimum (closed interval, for MARKET_CAP/PE)
      interval_max Range maximum (closed interval, for MARKET_CAP/PE)
      price_filter Price filter enum (PriceFilter, required for PRICE type)
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns (all_count, DataFrame) tuple
    str When ret != RET_OK, returns error description
    • Data format:
      Field Type Description
      security str Stock code (e.g. 'US.TSLA')
      name str Stock name
      after_hours_price float After-hours price
      after_hours_change_ratio float After-hours change rate (%)
      after_hours_change_amount float After-hours change amount
      after_hours_turnover float After-hours turnover
      after_hours_volume int After-hours volume
      close_price float Close price (previous trading day)
      change_ratio float Intraday change rate (%)
      change_amount float Intraday change amount
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, data = quote_ctx.get_us_after_hours_rank(count=2)
if ret == RET_OK:
    all_count, df = data
    print(f'Total count: {all_count}')
    print(df)
else:
    print('error:', data)

quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
  • Output
总数据量: 17728
  security                   name  after_hours_price  after_hours_change_ratio  after_hours_change_amount  after_hours_turnover  after_hours_volume  close_price  change_ratio  change_amount
0   US.MGN                  Megan               0.33                    92.048                      0.158          2.811130e+07            90547558        0.172     30.303030           0.04
1  US.QNRX  Quoin Pharmaceuticals               4.85                    49.230                      1.600          1.498305e+07             3050404        3.250    -26.303855          -1.16
1
2
3
4

API Limits

  • Maximum 60 requests within 30 seconds
  • Only the first page of paginated requests counts toward rate limiting