The barn swallow typically feeds in open areas above shallow water or the ground often following animals, humans or farm machinery to catch disturbed insects, but it will occasionally pick prey items from the water surface, walls and plants. In the breeding areas, large flies make up around 70% of the diet, with aphids also a significant component. However, in Europe, the barn swallow consumes fewer aphids than the house or sand martins. On the wintering grounds, Hymenoptera, especially flying ants, are important food items. When egg-laying barn swallows hunt in pairs, but otherwise will form often large flocks.