How can I get channel analytics via the API?

So basically poll the API every n seconds to build some timeseries?