You can run custom querys (BQL) like with the bean-query tool. For a detailed explanation of how queries can be created see the Beancount Query Lanugage Reference, or more generally, the Beancount Documentation Overview.
Sample queries can be found here (please submit your own queries if they might be useful for others).
{% if not api.queries() %}
If you add query-Directives to your Source these stored queries will be displayed as a dropdown to quickly select them.