Can we demand data from API grouped by HOUR for the last n-days?

I am developing a custom plugin - so my query is a graph with Pageviews by hour, total pageviews, and then top pages of the day and their pageviews at the bottom.

Can I request data for the LAST N-Days grouped by hour -
Basically If total Page Views are 10 thousand - then I want to see page views SPLIT by the hour in last N hours against the TOTAL Page Views.

Eg :

500 in 1st hour OR @ 1am 2000 at 5th hour or 4 pm etc. And all of it sums to Total Page view i.e. 10 thousand