Sometimes instead of just listing entities, you want to group them into facets, and count how many entities are in each group. For example, maybe you want to count the number of Works by open access status. To do that, you call the entity endpoint, adding the group_by parameter. Example:
For one group, both key and key_display_name are "3".
Group-by meta properties
meta.count is the total number of works (this will be all works if no filter is applied). meta.groups_count is the count of groups (in the current page).
If there are no groups in the response, meta.groups_count is null.
Due to a technical limitation, we can only report the number of groups in the current page, and not the total number of groups.
Paging
The maximum number of groups returned is 200. If you want to get more than 200 groups, you can use cursor pagination. This works the same as it does when getting lists of entities, so head over to the section on paging through lists of results to learn how.
Due to technical constraints, when paging, results are sorted by key, rather than by count.