KSC Open API
Kaspersky Security Center API description
int HostGroup::GetGroupId ( int  nParent,
wstring  strName 
)

Receives the administration group ID by using its name and the parent group ID.

Parameters:
nParent(int) parent group ID.
strName(wstring) administration group name.
Returns:
(int) ID of the found administration group. The attribute takes the -1 value if no group was found.

See also how to use the KlAkOAPI Python package:

            def FindGroupByLongName(oHostGroup, strFullName):
                oArray = strFullName.split("/")   
                nLastGroupId = oHostGroup.GroupIdGroups().RetVal()
                for oElem in oArray:
                    if oElem == '':
                        continue
                    nLastGroupId = oHostGroup.GetGroupId(nLastGroupId, oElem).RetVal()
                    if nLastGroupId == -1:
                        break
                return nLastGroupId