Skip to Content

Historical Market Temperature

This interface is used to get historical market temperature.

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

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

StatusDescriptionSchema
200SuccessHistoryMarketTemperatureResponse
400Parameter ErrorNone

Schemas

HistoryMarketTemperatureResponse

NameTypeRequiredDescription
listobject[]trueList
∟timestampintegertrueTimestamp
∟temperatureintegertrueTemperature
∟valuationintegertrueValuation
∟sentimentintegertrueSentiment
typestringtrueData granularity
day: daily; week: weekly; month: monthly

Error Codes

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