跳到主要內容

历史市场温度

该接口用于获取历史市场温度。

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

import datetime
from longport.openapi import QuoteContext, Config, Market

config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.history_market_temperature(Market.US, datetime.date(2024, 1, 1), datetime.date(2025, 1, 1))
print(resp)

Response

Response Headers

  • Content-Type: application/json

Response Example

{
"code": 0,
"data": {
"type": "month",
"list": [
{
"timestamp": 1580486400,
"temperature": 36,
"valuation": 12,
"sentiment": 46
},
{
"timestamp": 1582992000,
"temperature": 46,
"valuation": 12,
"sentiment": 46
}
]
}
}

Response Status

StatusDescriptionSchema
200返回成功HistoryMarketTemperatureResponse
400参数错误None

Schemas

HistoryMarketTemperatureResponse

NameTypeRequiredDescription
listobject[]true历史温度列表
∟timestampintegertrue时间戳
∟temperatureintegertrue温度值
∟valuationintegertrue估值值
∟sentimentintegertrue情绪值
typestringtrue数据颗粒度
day: 日;week: 周;month: 月

错误码

业务错误码描述排查建议
2601500服务端内部错误请重试或联系技术人员处理