Unofficial API for Python here. It only gives access to current measured state, so you will need to poll and store yourself.
If you want ready-built sampling, time series data storage and data querying and charting, you might want to set up Home Assistant with Influxdb and Grafana, using the off-the-shelf Sense integration.