Historical Market Temperature
This interface is used to get historical market temperature.
SDK Links
Python |
Rust |
Go |
Node.js |
Request
HTTP Method | GET |
HTTP URL | /v1/quote/history_market_temperature |
Parameters
Name | Type | Required | Description |
---|---|---|---|
market | string | YES | Market, currently supports US, HK, SG, CN |
start_date | string | YES | Start date, minimum to 2016, e.g.: 20240101 |
end_date | string | YES | End 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
Status | Description | Schema |
---|---|---|
200 | Success | HistoryMarketTemperatureResponse |
400 | Parameter Error | None |
Schemas
HistoryMarketTemperatureResponse
Name | Type | Required | Description |
---|---|---|---|
temperatures | object[] | true | Historical temperature list |
∟timestamp | integer | true | Timestamp |
∟value | integer | true | Value |
∟type | string | true | Data granularity day: daily; week: weekly; month: monthly |
valuations | object[] | true | Historical valuation list |
∟timestamp | integer | true | Timestamp |
∟value | integer | true | Value |
∟type | string | true | Data granularity day: daily; week: weekly; month: monthly |
sentiments | object[] | true | Market sentiment list |
∟timestamp | integer | true | Timestamp |
∟value | integer | true | Value |
∟type | string | true | Data granularity day: daily; week: weekly; month: monthly |
Error Codes
Business Error Code | Description | Troubleshooting Suggestions |
---|---|---|
2601500 | Server Internal Error | Please retry or contact technical support |