The Chart API is what we use on io.adafruit.com to populate charts over varying timespans with a consistent number of data points. The maximum number of points returned is 480. This API works by aggregating slices of time into a single value by averaging.
All time-based parameters are optional, if none are given it will default to 1 hour at the finest-grained resolution possible.