There's no API function to do what you ask, but it's easily done by iterating over `minetest.registered_items` and comparing if the item has the group set and more than zero. I'll leave the coding as an exercise to the reader.
Also, in the future please post modding questions in the
Modding Discussion subforum to keep things orderly :) I have moved this one there.