Ergotamine is a secondary metabolite (natural product) and the principal alkaloid produced by the ergot fungus, Claviceps purpurea, and related fungi in the family Clavicipitaceae. It possesses structural similarity to several neurotransmitters, and has biological activity as a vasoconstrictor. It is used medicinally for treatment of acute migraine attacks (sometimes in combination with caffeine), and to induce childbirth and prevent post-partum haemorrhage.