Optimise control strategies of infectious diseases, identify factors that favour the circulation of pathogens, and propose risk maps are crucial challenges for global health. Ecological niche modelling, once relying on an adequate framework and environmental descriptors can be a helpful tool for such purposes. Despite the existence of a vaccine, yellow fever (YF) is still a public health issue. Brazil faced massive sylvatic YF outbreaks from the end of 2016 up to mid-2018, but cases in human and non-human primates have been recorded until the beginning of 2020. Here we used both human and monkey confirmed YF cases from two epidemic periods (2016/2017 and 2017/2018) to describe the spatial distribution of the cases and explore how biotic and abiotic factors drive their occurrence. The distribution of YF cases largely overlaps for humans and monkeys, and a contraction of the spatial extent associated with a southward displacement is observed during the second period of the epidemics. More contributive variables to the spatiotemporal heterogeneity of cases were related to biotic factors (mammal richness), abiotic factors (temperature and precipitation), and some human-related variables (population density, human footprint, and human vaccination coverage). Both projections of the most favourable conditions showed similar trends with a contraction of the more at-risk areas. Once extrapolated at a large scale, the Amazon basin remains at lower risk, although surrounding forest regions and notably the North-West region, would face a higher risk. Spatial projections of infectious diseases often relied on climatic variables only; here for both models, we instead highlighted the importance of considering local biotic conditions, hosts vulnerability, social and epidemiological factors to run the spatial risk analysis correctly: all YF cases occurring later on, in 2019 and 2020, were observed in the predicted at-risk areas. Yellow fever (YF) is a vector-borne disease and from December 2016 until 2020, caused infection and death in humans and monkeys in the Southeast and South of Brazil. The transmission cycle includes hosts and vectors whose presence and abundance are driven by environmental conditions. Ecological niche models are expected to identify biotic and abiotic conditions favourable to a species and to predict its likelihood of presence. Such models have shown their relevance to determine the environmental and anthropogenic variables favourable for host and vector species of infectious diseases, and consequently for highlighting more at-risk areas. Relying on human and monkey populations, we showed how temperature, rain, predicted mammal density, human impact, and vaccination coverage explained the occurrence of YF cases in 2017–2018 Brazilian epidemics. We predicted at-risk areas for future outbreaks, including areas outside and surrounding the Amazon basin, YF cases occurring later, in 2019 and 2020, were observed in the predicted at-risk areas using our modelling approach. This modelling approach, relying on ecology theory and methodological framework for using epidemiological data, helps to identify human threatened populations, for which vaccination efforts should be oriented, and also for monkeys whose preservation is the main biodiversity concern.