You can also get the communityID from the URL of content creation actions for that space, i.e. if you visit the space and and hover the mouse over Create a Document, it is the attribute container=[communityID].