ABSTRACT This study aims to investigate the factors affecting lead and cadmium levels in urban fruits, a topic that has received little attention despite potential health risks. Tehran’s Tarasht neighborhood was chosen due to heavy traffic and the presence of numerous urban gardens with fruit trees. Specifically, this study explored how barriers (defined as artificial structures like walls), urban fruit tree height, distance from the sampling site to the street, and fruit type influence the content of lead and cadmium in these urban fruits. The results revealed that sites taller than 10 meters exhibited the highest cadmium levels, while sites without barriers or with 4-meter barriers demonstrated the highest lead content. Barrier width also had a significant influence, with unobstructed sites showing the highest lead content, and sites with 41-50-meter width barriers displaying the highest cadmium levels. Urban fruit tree height affected lead content, while cadmium levels remained unaffected. Additionally, heavy metal absorption was influenced by the distance to the street and the type of fruit. These findings can be used in the future for the development of guidelines for healthy and edible green infrastructure to reduce pollutants and promote safer urban horticultural practices.