It should be possible to use aggreation queries via either REST or GraphQL (and any other, future API modules).