A novel, green, one-pot and energy efficient route has been developed for the synthesis of gold nanoparticles by natural sunlight irradiation, and they were utilized effectively for the colorimetric detection of Ni2+ and Co2+ ions.