group_by parameter aggregates entities into groups and counts how many are in each group.
Group properties
Each group object contains:| Property | Description |
|---|---|
key | The OpenAlex ID or raw value for this group |
key_display_name | The display name or raw value for this group |
count | Number of entities in the group |
key vs key_display_name
When grouping by an OpenAlex entity, key is the ID and key_display_name is the display name:
level), both key and key_display_name are the raw value.
Including unknowns
The “unknown” group (entities without a value) is hidden by default. Add:include_unknown to include it:
Combining with filters
Group by and filter work together:Paging
Maximum 200 groups per page. Use cursor paging for more.When paging through groups, results are sorted by
key (not by count).Meta properties
| Property | Description |
|---|---|
meta.count | Total entities matching the filter |
meta.groups_count | Number of groups in current page (or null if none) |
Due to technical limitations,
groups_count only reports groups in the current page, not the total number of groups.