Get the Term Group from current site using Server Side object model

  1. Group group= null;  
  2.   
  3. _siteId = SPContext.Current.Site.ID;   
  4.   
  5. using (SPSite site = new SPSite(_siteId))    
  6.    {  
  7.        TaxonomySession taxonomySession = new TaxonomySession((SPSite)site);  
  8.         if (taxonomySession.TermStores.Count != 0)  
  9.            {  
  10.                TermStore termStore = taxonomySession.TermStores[0]; //default term store
  11.                 group = termStore.Groups["group name"];                  
  12.                    
  13.            }  
  14.    }