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 |
|---|---|---|
Market | string | market |
MarketStatus | string | marketStatus |
Status | string | status |
OpenTime | string | openTime |
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"
}
]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 |
Returns
([]model.TradingCalendarItem, error). Key fields from model.TradingCalendarItem:
| Field | Type | JSON field |
|---|---|---|
Market | string | market |
Date | string | date |
IsTrading | bool | isTrading |
SessionType | string | sessionType |
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 current market-data access for this client device and returns the granted permissions.
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 |
|---|---|---|
Name | string | name |
ExpireAt | int64 | expireAt |
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
}
]GetQuotePermission
GetQuotePermissionPurpose
Retrieves quote permission data and decodes it 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 |
Returns
([]model.QuotePermission, error). Key fields from model.QuotePermission:
| Field | Type | JSON field |
|---|---|---|
Name | string | name |
ExpireAt | int64 | expireAt |
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
}
]GetKlineQuota
GetKlineQuotaPurpose
Retrieves kline quota data 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 |
|---|---|---|---|---|
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 |
|---|---|---|
Method | string | method |
Used | int | used |
Quota | int | quota |
Detail | []KlineQuotaDetail | detail |
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,
"quota": 6000,
"detail": []
}
]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 |
|---|---|---|
UserLevel | FlexString | userLevel |
ActivePlan | *AddonActivePlan | activePlan |
Addons | []AddonInfo | addons |
EffectiveEntitlement | *AddonEntitlementDetail | effectiveEntitlement |
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 8 days ago
