We have developed two miniaturized HPGe gamma spectrometers for airborne environmental monitoring with unmanned aerial vehicles (UAVs). The spectrometers have been optimised for UAVs with a load capacity of up to 10 kg, a control radius of up to 3 km and a flight endurance without recharging of up to 30 min at a loading of 6 kg. The weights of the spectrometers with Stirling electrical cooling and cooling by liquid nitrogen were 5.8 and 2.6 kg, respectively. Both spectrometers were tested at two photon energy levels -122 keV and 1332 keV. Energy resolution with electrical cooling was 2.1 keV and 2.6 keV while the spectrometer with liquid nitrogen cooling had energy resolution of 1.2 keV and 2.2 keV when tested at the same energy levels.