Skip to main content

Historical Market Temperature

This interface is used to get historical market temperature.

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
marketstringYESMarket, currently supports US, HK, SG, CN
start_datestringYESStart date, minimum to 2016, e.g.: 20240101
end_datestringYESEnd date, e.g.: 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
200SuccessHistoryMarketTemperatureResponse
400Parameter ErrorNone

Schemas

HistoryMarketTemperatureResponse

NameTypeRequiredDescription
temperaturesobject[]trueHistorical temperature list
∟timestampintegertrueTimestamp
∟valueintegertrueValue
∟typestringtrueData granularity
day: daily; week: weekly; month: monthly
valuationsobject[]trueHistorical valuation list
∟timestampintegertrueTimestamp
∟valueintegertrueValue
∟typestringtrueData granularity
day: daily; week: weekly; month: monthly
sentimentsobject[]trueMarket sentiment list
∟timestampintegertrueTimestamp
∟valueintegertrueValue
∟typestringtrueData granularity
day: daily; week: weekly; month: monthly

Error Codes

Business Error CodeDescriptionTroubleshooting Suggestions
2601500Server Internal ErrorPlease retry or contact technical support