Peru is the eighth largest producer of cacao beans globally, but high cadmium contents are constraining access to international markets which have set upper thresholds for permitted concentrations in chocolate and derivatives. Preliminary data have suggested that high cadmium concentrations in cacao beans are restricted to specific regions in the country, but to date no reliable maps exist of expected cadmium concentrations in soils and cacao beans. Drawing on >2,000 representative samples of cacao beans and soils we developed multiple national and regional random forest models to develop predictive maps of cadmium in soil and cacao beans across the area suitable for cacao cultivation. Our model projections show that elevated concentrations of cadmium in cacao soils and beans are large Loreto, as well as some very localized pockets in the central departments of Huánuco and San Martin. Unsurprisingly, soil cadmium was the by far most important predictor of bean cadmium. Aside from the south-eastern to north-western spatial trend of increasing cadmium values in soils and beans, the most important predictors of both variables in nation-wide models were geology, rainfall seasonality, soil pH and rainfall. At regional level, alluvial deposits and mining operations were also associated with higher cadmium levels in cacao beans. Based on our predictive map of cadmium in cacao beans we estimate that while at a national level less than twenty percent of cacao farming households might be impacted by the cadmium regulations, in the most affected department of Piura this could be as high as 89%.