The Smithsonian Venezuela Project (SVP) conducted extensive surveys of mammals and ectoparasites in the 1960s. The 25 238 individuals and 130 species of bat collected by SVP hosted 36 663 streblid bat flies, representing 116 species of these ectoparasitic dipterans. Roosts of bat species differ in durability and protection, and bat flies separate from the host to pupate in the roost. We predicted higher levels of parasitism and more parasitic associates for bats roosting in more permanent structures (e.g. caves, tunnels) that would facilitate their association with hosts. We also predicted wing development of flies should correlate inversely with roost duration, restricting flightless forms to bats in permanent roosts. Ranking roosting structures by durability and protection, we sought correlations among bat species in prevalence, mean intensity and number of associated fly species. All three measures of parasitism were positively and significantly related to roosting habits: bats roosting in more permanent, enclosed structures were more likely to be infested, to carry heavier parasite loads, and to harbour more species of ectoparasitic flies. However, roosting habits were not correlated with the average wing development of bat flies. Although other factors affect parasitism rates in bats, the study provides a compelling example of both ecological and evolutionary responses of parasites to features of the host's environment.