View what was the entity state at a given time

Hi! I would like to define a intent script that returns the entity state at a given time in the past. So considering this intent will receive an entity id and timestamp, is it possible to retrieve what was the entity status? I’ve found that RESTful API can return history data… But couldn’t find a way to do the same inside a intent script.