The National Basketball Association ( NBA ) is a professional basketball league in North America comprising 30 franchises , of which 29 are located in the United States and one in Canada ( Toronto Raptors ) .