How can I get channel analytics via the API?

There are no analytics/historical endpoints.

So you’d have to collect data in real time for the data points you need.