How can I get frequent visitors information from piwik

I am looking for an API that can give me the say the top 30 visitors by visit count for the last month. Something similar to the visitor log but grouped by userId.

Do we have something like that?

Maybe you want use the Custom Dimensions feature?
In the FAQs there’s also a comparison of Dimensions Vs Variables.