Urbanization is affecting arthropod communities worldwide, for example by changing the availability of food resources. However, the strength and direction of a community's response is species‐specific and depends on species' trophic level. Here, we investigated interacting species at different trophic levels in nests of cavity‐nesting bees and wasps along two urbanization gradients in four German cities using trap nests. We analysed bee and wasp diversity and their trophic interaction partners by metabarcoding the DNA of bee pollen and preyed arthropods found in wasp nests. We found that the pollen richness increased with increasing distance from city centres and at sites characterized by a high percentage of impervious and developed surface, while the richness of pollinators was unaffected by urbanization. In contrast, species richness of wasps, but not their arthropod prey, was highest at sites with low levels of urbanization. However, the community structure of wasp prey changed with urbanization at both local and regional scales. Throughout the study area, the community of wasps consisted of specialists, while bee species were generalists. Our results suggest that Hymenoptera and their food resources are negatively affected by increasing urbanization. However, to understand distribution patterns of both, wasps and bees in urban settings other factors besides food availability should be considered.