Serotonin or 5-hydroxytryptamine (5-HT) regulates a wide spectrum of human physiology through the 5-HT receptor family. We report the crystal structures of the human 5-HT1B G protein-coupled receptor bound to the agonist antimigraine medications ergotamine and dihydroergotamine. The structures reveal similar binding modes for these ligands, which occupy the orthosteric pocket and an extended binding pocket close to the extracellular loops. The orthosteric pocket is formed by residues conserved in the 5-HT receptor family, clarifying the family-wide agonist activity of 5-HT. Compared with the structure of the 5-HT2B receptor, the 5-HT1B receptor displays a 3 angstrom outward shift at the extracellular end of helix V, resulting in a more open extended pocket that explains subtype selectivity. Together with docking and mutagenesis studies, these structures provide a comprehensive structural basis for understanding receptor-ligand interactions and designing subtype-selective serotonergic drugs.