All that information is in the category tree service response. If you look closely at the response, you will find that at the beginning, there are top level categories like "Restaurant" which has a bunch of child category ids, but if you go past the middle of the list, you find that you get the child categories, and they don't have any children under them. Looking at the list there appears to be 105 top level categories and 502 child categories (based on the length of the ID. I assumed the 4-digit IDs were top level, and the 7-digit IDs are child level).
I've taken the response and broke it up into some tables in Excel (you can access it from my OneDrive here as it won't let me attach it in the forums). Note that the purpose of having an API is that categories may change over time. That said, I don't think they will change that often, so you likely don't want/need to call this constantly.