API apply groupby

Thank you all for your quick answers! Really appreciate this!
Unfortunatelly I don’t have access to the BC development environment, so while creating and exposing a query is most likely the solution, I’m not able to do this :-(.
I ended up grouping a bunch of inquiries (making use of orderby and top=1) in one batch request. Not the most optimal solution performance-wise, but it is working and fast enough at the moment.