Market State
POST/api/v1.0/quote/market-stateGet the current market state (open / closed / pre-market / after-hours / overnight / closing auction, etc.) for a batch of symbols. Useful for determining quote availability and freshness.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
code_list | string[] | body | yes | List of symbol codes in {market}.{code} format, e.g. ["HK.00700","US.AAPL","SH.600519"]. Market prefix is required. Max 400 per batch. |
is_contain_ba | bool | body | no | Whether to include US pre-market/after-hours sessions; true switches trade_section to the next trading day's schedule once pre/after-hours begins. Default false. Only affects US-related entries. |
is_contain_overnight | bool | body | no | Whether to include US overnight session; true switches trade_section to the next trading day's schedule once overnight begins. Default false. Only affects US-related entries. |
is_need_crypto_multi_broker | bool | body | no | Whether to return multi-broker data for crypto market; true expands multiple records per market_id by broker. Default false. Only affects CC. prefix entries. |
Request Example
bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/quote/market-state' \
-H 'Content-Type: application/json' \
-d '{"code_list":["HK.00700","US.AAPL","SH.600519","SZ.000001"]}' | jqResponse Fields
Returns data.market_state_list[], with elements as follows.
| Field | Type | Description |
|---|---|---|
code | string | Symbol code, e.g. HK.00700, echoed from the request |
stock_name | string | English stock name (from local security cache); omitted for unsupported markets or unlisted securities. |
sc_name | string | Simplified Chinese name. |
tc_name | string | Traditional Chinese name. |
market_state | string | Market state enum (string). See Naming Dictionary > market_state |
time_date | string | Trading date for the market, format YYYY-MM-DD HH:MM:SS (Beijing timezone). Omitted when not provided by backend |
traded_seconds | int | Seconds already traded in current session. Omitted when not provided by backend |
total_seconds | int | Total seconds of current trading session. Omitted when not provided by backend |
trade_section | array | Trading session slices for the day; elements contain trade_section_type (int, see Naming Dictionary > trade_section_type), begin_time / end_time (Beijing timezone HH:MM:SS). Omitted when not provided by backend |
broker_id | int | Only returned for crypto + is_need_crypto_multi_broker=true; identifies the broker for this record |
broker_ids | int[] | Returned for crypto aggregated quotes; lists all broker IDs under that market_id |
Supported Markets
- Code must use a supported market prefix from the 11 markets listed below; otherwise returns
invalid_symbol:HK(Hong Kong) /US(United States) /SH(Shanghai A-shares) /SZ(Shenzhen A-shares) /BJ(Beijing Stock Exchange) /SG(Singapore) /JP(Japan) /CA(Canada) /AU(Australia) /SH_FX(Shanghai-Shenzhen FX) /CC(Crypto). - Unsupported market prefixes (not limited to):
DEGermany,FRFrance,GBUK,MYMalaysia,THThailand,IDIndonesia,VNVietnam,NZNew Zealand,NLNetherlands,PTPortugal,ITItaly. - For unsupported markets: the corresponding entry retains the requested code,
market_statereturns"NONE", extended fields are omitted; does not affect other valid symbols in the same batch. - Max
code_listlength is 400; exceeding or empty array returnsinvalid_parameter. - Market prefix is required; missing prefix (e.g.
"00700") triggersinvalid_parameter.
Error Codes
| ret_code | error.code | Trigger Condition | Recommended Action |
|---|---|---|---|
| 0 | — | Success, data.market_state_list length equals request code_list length | Iterate market_state_list, match by code to your requested symbols |
| -3 | invalid_parameter | code_list missing / element type not string / list empty / length exceeds 400 / element missing market prefix | Fix request body, ensure {market}.{code} format |
| -5 | backend_biz_error | QTA backend returned non-zero business error (rare) | Read error.message for details; may retry |
| -2 / -4 / -6 | internal_error | Gateway routing / body construction / response conversion exception | Retain x-trace-id and report to gateway team |
Response Example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"market_state_list": [
{ "code": "HK.00700", "market_state": "AFTERNOON", "stock_name": "腾讯控股" },
{ "code": "US.AAPL", "market_state": "AFTER_HOURS_END", "stock_name": "苹果" },
{ "code": "SH.600519", "market_state": "AFTERNOON", "stock_name": "贵州茅台" },
{ "code": "SZ.000001", "market_state": "AFTERNOON", "stock_name": "平安银行" }
]
}
}