Understanding the ecological roles of pterosaurs is a challenging pursuit, but one aided by a growing body of fossil evidence for their dietary preferences and roles as food sources for other species. Pterosaur foraging behaviour is represented by preserved gut content, stomach regurgitates, coprolites and feeding traces. Pterosaurs being eaten by other species are recorded by tooth marks and teeth embedded in their fossil bones, consumer gut content and regurgitate, and their preservation entangled with predatory animals. This palaeoecological record has improved in recent years, but remains highly selective. The Jurassic rhamphorhynchid Rhamphorhynchus, Cretaceous ornithocheiroid Pteranodon and azhdarchid pterosaurs currently have the most substantial palaeoecological records. The food species and consumers of these taxa conform to lifestyle predictions for these groups. Rhamphorhynchus and Pteranodon ate and were eaten by aquatic species, matching expectations of these animals as sea-going, perhaps partly aquatic species. Possible azhdarchid pterosaur foraging traces alongside pterosaur tracks, and evidence that these animals were eaten by dinosaurs and Crocodyliformes, are consistent with hypotheses that azhdarchids foraged and lived in terrestrial settings. Fossil evidence of pterosaur palaeoecology remains rare: researchers are strongly encouraged to put specimens showing details of dietary preferences, foraging strategies or interactions with other animals on record.