General
GetMarketState
GetMarketStatePurpose
Retrieves market state data and decodes it into the published Go return model.
Signature
func (c *QuoteClient) GetMarketState(market string) ([]model.MarketState, error)Availability depends on market, instrument, and enabled data access.
Parameters
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
market | string | Yes | None | Market code; SDK enum values are ALL/US/HK/CN/SG |
Returns
([]model.MarketState, error). Key fields from model.MarketState:
| Field | Type | JSON field | Description |
|---|---|---|---|
Market | string | market | Market code. |
MarketStatus | string | marketStatus | Display market-status label. |
Status | string | status | Market trading-status code. |
OpenTime | string | openTime | Scheduled market opening time. |
Invocation example
result, err := qc.GetMarketState("US")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"market": "US",
"marketStatus": "Pre-Mkt",
"status": "PRE_HOUR_TRADING",
"openTime": "08-03 09:30:00 EDT"
}
]Rate limit
The base rate limit is 10 requests/min.
GetTradingCalendar
GetTradingCalendarPurpose
Retrieves trading calendar data and decodes it into the published Go return model.
Signature
func (c *QuoteClient) GetTradingCalendar(req model.TradingCalendarRequest) ([]model.TradingCalendarItem, error)Availability depends on market, instrument, and enabled data access.
Parameters
model.TradingCalendarRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Market | string | No | Omitted if empty | Allowed values: ALL, US, HK, CN, SG |
BeginDate | string | No | Omitted if empty | None; yyyy-MM-dd |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
EndDate | string | No | Omitted when empty | End date |
Returns
([]model.TradingCalendarItem, error). Key fields from model.TradingCalendarItem:
| Field | Type | JSON field | Description |
|---|---|---|---|
Market | string | market | Market code. |
Date | string | date | Calendar date. |
IsTrading | bool | isTrading | Whether the market trades on this date. |
SessionType | string | sessionType | Trading-session classification. |
Invocation example
result, err := qc.GetTradingCalendar(model.TradingCalendarRequest{
Market: "US",
BeginDate: "2025-01-01",
EndDate: "2025-01-31",
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"market": "US",
"date": "2025-07-28",
"isTrading": true,
"sessionType": "TRADING"
},
{
"market": "US",
"date": "2025-07-29",
"isTrading": true,
"sessionType": "TRADING"
}
]GrabQuotePermission
GrabQuotePermissionPurpose
Claims market data device access for this client device and returns the account's existing market data permission entries. This operation does not purchase or grant new market data access.
Signature
func (c *QuoteClient) GrabQuotePermission() ([]model.QuotePermission, error)Availability depends on market, instrument, and enabled data access.
Parameters
No parameters.
Returns
([]model.QuotePermission, error). Key fields from model.QuotePermission:
| Field | Type | JSON field | Description |
|---|---|---|---|
Name | string | name | Market-data permission name. |
ExpireAt | int64 | expireAt | Permission expiration timestamp. |
Invocation example
result, err := qc.GrabQuotePermission()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"name": "usStockQuote",
"expireAt": 1824291899000
},
{
"name": "hkStockQuoteLv2",
"expireAt": -1
},
{
"name": "usOptionQuoteLv2",
"expireAt": 1794121342000
}
]Rate limit
The base rate limit is 10 requests/min.
GetQuotePermission
GetQuotePermissionPurpose
Retrieves market data permission entries and decodes them into the published Go return model.
Signature
func (c *QuoteClient) GetQuotePermission(req model.QuotePermissionRequest) ([]model.QuotePermission, error)Availability depends on market, instrument, and enabled data access.
Parameters
model.QuotePermissionRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
BeginDate | string | No | Omitted when empty | Start date |
EndDate | string | No | Omitted when empty | End date |
Returns
([]model.QuotePermission, error). Key fields from model.QuotePermission:
| Field | Type | JSON field | Description |
|---|---|---|---|
Name | string | name | Market-data permission name. |
ExpireAt | int64 | expireAt | Permission expiration timestamp. |
Invocation example
result, err := qc.GetQuotePermission(model.QuotePermissionRequest{
BeginDate: "2025-01-01",
EndDate: "2025-01-31",
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"name": "usStockQuote",
"expireAt": 1824291899000
},
{
"name": "hkStockQuoteLv2",
"expireAt": -1
},
{
"name": "usOptionQuoteLv2",
"expireAt": 1794121342000
}
]Rate limit
The base rate limit is 10 requests/min.
GetKlineQuota
GetKlineQuotaPurpose
Retrieves candlestick bar (K-line data) quota and decodes it into the published Go return model.
Signature
func (c *QuoteClient) GetKlineQuota(req model.KlineQuotaRequest) ([]model.KlineQuota, error)Availability depends on market, instrument, and enabled data access.
Parameters
model.KlineQuotaRequest
| SDK field | Type | Required | Serialization | SDK default and constraints |
|---|---|---|---|---|
WithDetails | bool | No | Omitted when false | Whether to request per-symbol quota details |
Lang | string | No | Omitted if empty | Allowed values: zh_CN, zh_TW, en_US |
Returns
([]model.KlineQuota, error). Key fields from model.KlineQuota:
| Field | Type | JSON field | Description |
|---|---|---|---|
Method | string | method | Quota operation name. |
Used | int | used | Number of bars already used. |
Quota | int | quota | Total bar quota. |
Detail | []KlineQuotaDetail | detail | Per-symbol quota details. |
KlineQuotaDetail field | Type | JSON field |
|---|---|---|
Symbol | string | symbol |
Market | string | market |
UsedBars | int | usedBars |
QuotaBars | int | quotaBars |
LastAccess | int64 | lastAccess |
The current API response may not populate Quota, Detail, or KlineQuotaDetail fields, in which case they remain unavailable or zero-valued. Method and Used are populated when present. The method returns only the typed result above and does not expose raw response fields.
Invocation example
result, err := qc.GetKlineQuota(model.KlineQuotaRequest{
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)[
{
"method": "kline",
"used": 120
}
]Rate limit
The base rate limit is 10 requests/min.
GetAddonEntitlement
GetAddonEntitlementPurpose
Retrieves addon entitlement data and decodes it into the published Go return model.
Signature
func (c *QuoteClient) GetAddonEntitlement() (*model.AddonEntitlement, error)Availability depends on market, instrument, and enabled data access.
Parameters
No parameters.
Returns
(*model.AddonEntitlement, error). Key fields from model.AddonEntitlement:
| Field | Type | JSON field | Description |
|---|---|---|---|
UserLevel | FlexString | userLevel | User plan level. |
ActivePlan | *AddonActivePlan | activePlan | Current plan details. |
Addons | []AddonInfo | addons | Add-on plan entries. |
EffectiveEntitlement | *AddonEntitlementDetail | effectiveEntitlement | Effective market-data entitlements. |
AddonActivePlan field | Type | JSON field |
|---|---|---|
PlanType | string | planType |
ExpireTime | int64 | expireTime |
AddonInfo field | Type | JSON field |
|---|---|---|
PlanType | string | planType |
Active | bool | active |
StartTime | int64 | startTime |
ExpireTime | int64 | expireTime |
AddonEntitlementDetail field | Type | JSON field |
|---|---|---|
HistoryStockLimit | int | historyStockLimit |
HistoryStockRemaining | int | historyStockRemaining |
HistoryFutureLimit | int | historyFutureLimit |
HistoryFutureRemaining | int | historyFutureRemaining |
HistoryOptionLimit | int | historyOptionLimit |
HistoryOptionRemaining | int | historyOptionRemaining |
SubscribeLimit | int | subscribeLimit |
SubscribeRemaining | int | subscribeRemaining |
SubscribeDepthLimit | int | subscribeDepthLimit |
SubscribeDepthRemaining | int | subscribeDepthRemaining |
HighFreqLimit | int | highFreqLimit |
MidFreqLimit | int | midFreqLimit |
LowFreqLimit | int | lowFreqLimit |
RateMultiple | int | rateMultiple |
Invocation example
result, err := qc.GetAddonEntitlement()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result){
"userLevel": "1",
"activePlan": null,
"addons": [],
"effectiveEntitlement": null
}Updated about 1 month ago
