The Mediterranean landscape of Serra de Grândola, Portugal, is one of many habitats inhabited by Eurasian badgers Meles meles, and in this area, the onset of food availability is seasonally predictable, but abundance is often temporally unpredictable and ephemeral. In our study, we investigated the responses of badgers to the temporal pattern of resource availability. We predicted that they would respond both to the seasonal timing of resource availability and to occasional pulses when food items are superabundant. We hypothesised that badgers' diet would reflect the seasonal onset of specific food resources, closely tracking food abundance, and that this tracking would reflect a relationship between the energetic value and water content of each resource and badger requirements at the time. To evaluate our predictions, we assessed the availability of the primary foods of badgers in Serra de Grândola (i.e. insects and fruits) over four years, and we analysed 120 faecal samples over one year to test for any congruence that might suggest tracking. Fruits and insects showed temporal fluctuations in peaks of availability that occurred on an annual basis, suggesting a temporal pulsing dynamic. Comparison of diet results with phenology and availability of food resources showed a high degree of overlap for practically all main items consumed. Moreover, the consumption of Coleoptera, olives Olea europaea and pears Pyrus bourgaeana appeared to be associated, but only partially, with their availability (rColeoptera = 0.21, P = 0.50; rolives = 0.36, P = 0.24; rpears = 0.20, P = 0.54); whilst acorns Quercus suber were closely tracked (racorns = 0.70, P = 0.01). Orthoptera were the only exception, with a negative relation between consumption and availability (rOthoptera = ‐0.31, P = 0.32). This tracking by badgers of primary resources with temporally differing peaks of availability and abundance appeared to involve trade‐offs with energy and water requirements. Acorns peaked simultaneously with olives which, although not as abundant, had a higher fat content. Other minor fruits (e.g. loquats Eriobotrya japonica and figs Ficus carica) also seemed to be tracked; they were important resources for badgers during summer when air temperatures were high. These results have implications for understanding badger ecology in areas with temporally unpredictable resources.