Getting entity attributes values through history endpoint in REST API

I’m using the history endpoint to query the value of some entities as a function of time, i.e.

url = f"http://hass.address/api/history/period/{start_time}"
headers = {
    "Authorization": f"Bearer {token}",
    "content-type": "application/json",
}
params = {
    "filter_entity_id" : "sensor.outdoor_temperature,climate.sonoff_trvzb_thermostat_2",
    "end_time" : end_time
}
response = requests.get(url, headers=headers, params=params)

This only returns the state of the entity and not of the entity attributes (which are still available in the database). For the climate entity (which is a thermostat) the informations stored in the attributes are also important because they store the current temperature, target temperature…

Is there any way to get those through a call to the history endpoint?
I’ve looked into the docs but it seems this is not supported, although with the latest version of Home Assistant in the history tab it is indeed possible to export a CSV with the attribute data inside, so it must be possible somehow…

Modern frontend mostly uses the websocket API, not the rest API. In Websocket the api call history/history_during_period has an option no_attributes which I believe indicates if attributes should or should not be returned with the states.

So that would be how the history tab is getting those values.

Can you post a link to the doc showing the endpoints? Couldn’t really find one where this history endpoint is described.
However, I’m not sure this is the solution because the option you mention (no_attributes) is also present in the REST API, but it only means that the entity attributes (like units, domain…) are not returned. It doesn’t refer to the attributes like temperature of a climate thermostat entity.

As far as I know there isn’t any documentation. Sorry I might have been wrong about the attributes flag, was just reading over the code a bit.