跳到主要內容

歷史市場溫度

該接口用於獲取歷史市場溫度。

SDK Links

Python
longport.openapi.QuoteContext.history_market_temperature
Rust
longport::quote::QuoteContext#history_market_temperature
Go
QuoteContext.HistoryMarketTemperature
Node.js
QuoteContext#historyMarketTemperature

Request

HTTP MethodGET
HTTP URL/v1/quote/history_market_temperature

Parameters

NameTypeRequiredDescription
marketstringYES市場,目前支持 US、HK、SG、CN
start_datestringYES開始日期,最小到 2016 年,比如:20240101
end_datestringYES結束日期,比如:20250101

Request Example

from longport.openapi import QuoteContext, Config, Market

config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.history_market_temperature(Market.US, "20240101", "20250101")
print(resp)

Response

Response Headers

  • Content-Type: application/json

Response Example

{
"code": 0,
"data": {
"temperatures": [
{
"timestamp": 1580486400,
"value": 36,
"type": "month"
},
{
"timestamp": 1582992000,
"value": 46,
"type": "month"
}
],
"valuations": [
{
"timestamp": 1580486400,
"value": 36,
"type": "month"
},
{
"timestamp": 1582992000,
"value": 46,
"type": "month"
}
],
"sentiments": [
{
"timestamp": 1580486400,
"value": 36,
"type": "month"
},
{
"timestamp": 1582992000,
"value": 46,
"type": "month"
}
]
}
}

Response Status

StatusDescriptionSchema
200返回成功HistoryMarketTemperatureResponse
400參數錯誤None

Schemas

HistoryMarketTemperatureResponse

NameTypeRequiredDescription
temperaturesobject[]true歷史溫度列表
∟timestampintegertrue時間戳
∟valueintegertrue
∟typestringtrue數據顆粒度
day: 日;week: 周;month: 月
valuationsobject[]true歷史估值列表
∟timestampintegertrue時間戳
∟valueintegertrue
∟typestringtrue數據顆粒度
day: 日;week: 周;month: 月
sentimentsobject[]true市場情緒列表
∟timestampintegertrue時間戳
∟valueintegertrue
∟typestringtrue數據顆粒度
day: 日;week: 周;month: 月

錯誤碼

業務錯誤碼描述排查建議
2601500服務端內部錯誤請重試或聯繫技術人員處理