Opioids and cannabinoids are two major classes of drugs with important clinical uses as well as significant side effects. Recently, the three major subtypes of opioid receptors, delta, kappa and mu, have been cloned. Both the endogenous cannabinoids and their receptors have also recently been cloned. These advances are facilitating attempts to understand the structural features of these receptors that are involved in their functioning, which should lead to the development of new and improved clinically useful opioids and cannabinoid-like drugs.