Historical Market Temperature
This interface is used to get historical market temperature.
SDK Links
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
python
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
json
{
"code": 0,
"data": {
"type": "month"
"list": [
{
"timestamp": 1580486400,
"temperature": 36,
"valuation": 12,
"sentiment": 46
},
{
"timestamp": 1582992000,
"temperature": 36,
"valuation": 12,
"sentiment": 46
}
]
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | Success | HistoryMarketTemperatureResponse |
| 400 | Parameter Error | None |
Schemas
HistoryMarketTemperatureResponse
| Name | Type | Required | Description |
|---|---|---|---|
| list | object[] | true | List |
| ∟timestamp | integer | true | Timestamp |
| ∟temperature | integer | true | Temperature |
| ∟valuation | integer | true | Valuation |
| ∟sentiment | integer | true | Sentiment |
| 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 |