Access to history data

I would like to implement a custom service that reads the entries of the history component for a configurable time period.

What would be the ‘best’ way to read this data? RESTful API? Direct access to the DB? Or exist internal functions, which I have not found so far?