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.