In a context of climate change, identifying the genes underlying adaptations to extreme environments is essential. Small ruminants are adapted to a wide variety of habitats and thus, are promising study models. Here, we considered 17 goat and 25 sheep local Mediterranean breeds, in Italy, France and Spain. We proposed, and empirically tested a new methodology to highlight selection signatures in relation to the environments. Based on historical archives, we selected the breeds potentially most linked to a territory and defined their original geographical cradle, including transhumant pastoral areas. For both species, the cradles were arranged along latitudinal gradient of aridity and altitude. Then we used the programs PCAdapt and LFMM. Considering cradles, instead of current GPS coordinates, markedly improved the sensitivity of the LFMM analyses. All the results combined with a systematic literature review, revealed a set of genes with potentially key adaptive roles. Some of these genes, have been found implicated in lipid metabolism (SUCLG2, BMP2), hypoxia/heat stress (UBE2R2/UBAP2), lung function (BMPR2), seasonal patterns (SOX2, DPH6) or neuronal function (TRPC4, TRPC6). For the intergenic region between PCDH9 and KLH1, as well as NBEA, identified in both species, the adaptive role could be strong. We found for RXFP2, associated with sheep horn development, and MSRB3 and SLC26A4, both associated with hearing of sheep, a strong association with the environment gradient. We conclude that our new methodology, which considers breeds in their historical, environmental and anthropological context, provides novel and essential information on local breeds and their unique adaptations.