AbstractAbiotic factors are limitations that can affect animal activity and distribution, whether directly or indirectly. The objective of this study was to evaluate how abiotic factors influence the activity of two mustelid species inhabiting the same region but different habitats in NE Poland—pine marten inhabits forests and stone marten occupy built-up areas. From 1991 to 2016, we obtained 23,639 year-round observations of 15 pine martens and 8524 observations of 47 stone martens. We explore the influence of ambient temperature, snow cover depth and moonlight reaching the ground and interactions between these variables on the probability of martens’ activity. The activity of pine martens living in natural habitats is more affected by climate conditions and moonlight than that of stone martens living in anthropogenic areas. Pine martens inhabiting forests increased activity when the ambient temperature was above 0 °C and snow cover was absent, as well as when the ambient temperature dropped to − 15 °C and snow cover depth was about 10 cm. Stone marten occupying anthropogenic areas did not reduce their activity if the temperature dropped. Variation of activity in relation to ambient conditions is probably related to pine martens’ behavioural thermoregulation. The pine marten was active more frequently on bright nights, while moonlight intensity did not affect the activity of the stone marten. Our study concludes that complex interactions among abiotic factors concerning different habitats play a synergetic role in shaping carnivore activity and suggest that climate warming may affect the behaviour of both martens.Significance statementThe survival and reproduction of animals depends on their activity, which is subject to various constraints. We studied the influence of climate conditions and moonlight intensity on the ground on the activity of pine and stone marten. We found that pine martens in natural habitat were greatly impacted by ambient conditions, whereas stone martens in built-up areas were less so. Natural habitats involve limitations related to harsh winters but may mitigate the effects of high temperatures. In contrast, animals living in built-up areas are exposed to higher temperatures in summer, which is of particular importance in the face of climate change. Our results show that the combination of several environmental factors affects animal behaviour and these factors have varying effects in various habitats.Supplementary InformationThe online version contains supplementary material available at 10.1007/s00265-023-03331-9.